[llvm-branch-commits] [libcxx] [llvm] [libc++][C++03] Use `__cxx03/` headers in C++03 mode (PR #109002)
Nikolas Klauser via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 11 06:39:45 PST 2024
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/109002
>From 13736442addefa4876c8919ec75ba16b295908e3 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Tue, 17 Sep 2024 17:35:33 +0200
Subject: [PATCH] [libc++][C++03] Use `__cxx03/` headers in C++03 mode
---
.github/workflows/libcxx-build-and-test.yaml | 1 +
.../cmake/caches/frozen-cxx03-headers.cmake | 2 +
libcxx/include/CMakeLists.txt | 7 +-
libcxx/include/__cxx03/CMakeLists.txt | 54 ++-----------
libcxx/include/__cxx03/__config | 2 +-
libcxx/include/__cxx03/__configuration/abi.h | 2 +-
.../__cxx03/__configuration/compiler.h | 2 +-
.../__configuration/config_site_shim.h | 80 +++++++++++++++++++
.../__cxx03/__configuration/language.h | 2 +-
.../__cxx03/__configuration/platform.h | 2 +-
.../locale_base_api/bsd_locale_fallbacks.h | 2 +-
.../__cxx03/__thread/support/pthread.h | 4 +-
libcxx/include/__cxx03/climits | 2 +-
libcxx/include/__cxx03/locale | 2 +-
libcxx/include/algorithm | 7 +-
libcxx/include/any | 7 +-
libcxx/include/array | 7 +-
libcxx/include/atomic | 7 +-
libcxx/include/barrier | 7 +-
libcxx/include/bit | 7 +-
libcxx/include/bitset | 7 +-
libcxx/include/cassert | 7 +-
libcxx/include/ccomplex | 7 +-
libcxx/include/cctype | 7 +-
libcxx/include/cerrno | 7 +-
libcxx/include/cfenv | 8 +-
libcxx/include/cfloat | 7 +-
libcxx/include/charconv | 7 +-
libcxx/include/chrono | 7 +-
libcxx/include/cinttypes | 7 +-
libcxx/include/ciso646 | 7 +-
libcxx/include/climits | 7 +-
libcxx/include/clocale | 7 +-
libcxx/include/cmath | 7 +-
libcxx/include/codecvt | 7 +-
libcxx/include/compare | 7 +-
libcxx/include/complex | 7 +-
libcxx/include/complex.h | 7 +-
libcxx/include/concepts | 7 +-
libcxx/include/condition_variable | 7 +-
libcxx/include/coroutine | 7 +-
libcxx/include/csetjmp | 7 +-
libcxx/include/csignal | 7 +-
libcxx/include/cstdalign | 7 +-
libcxx/include/cstdarg | 7 +-
libcxx/include/cstdbool | 7 +-
libcxx/include/cstddef | 7 +-
libcxx/include/cstdint | 7 +-
libcxx/include/cstdio | 7 +-
libcxx/include/cstdlib | 7 +-
libcxx/include/cstring | 7 +-
libcxx/include/ctgmath | 7 +-
libcxx/include/ctime | 7 +-
libcxx/include/ctype.h | 7 +-
libcxx/include/cuchar | 8 +-
libcxx/include/cwchar | 7 +-
libcxx/include/cwctype | 7 +-
libcxx/include/deque | 7 +-
libcxx/include/errno.h | 7 +-
libcxx/include/exception | 7 +-
libcxx/include/execution | 7 +-
libcxx/include/expected | 7 +-
libcxx/include/experimental/iterator | 7 +-
libcxx/include/experimental/memory | 7 +-
libcxx/include/experimental/propagate_const | 7 +-
libcxx/include/experimental/simd | 7 +-
libcxx/include/experimental/type_traits | 7 +-
libcxx/include/experimental/utility | 7 +-
libcxx/include/ext/hash_map | 7 +-
libcxx/include/ext/hash_set | 7 +-
libcxx/include/fenv.h | 7 +-
libcxx/include/filesystem | 7 +-
libcxx/include/flat_map | 7 +-
libcxx/include/float.h | 7 +-
libcxx/include/format | 7 +-
libcxx/include/forward_list | 7 +-
libcxx/include/fstream | 7 +-
libcxx/include/functional | 7 +-
libcxx/include/future | 7 +-
libcxx/include/initializer_list | 7 +-
libcxx/include/inttypes.h | 7 +-
libcxx/include/iomanip | 7 +-
libcxx/include/ios | 7 +-
libcxx/include/iosfwd | 7 +-
libcxx/include/iostream | 7 +-
libcxx/include/istream | 7 +-
libcxx/include/iterator | 7 +-
libcxx/include/latch | 7 +-
libcxx/include/limits | 7 +-
libcxx/include/list | 7 +-
libcxx/include/locale | 7 +-
libcxx/include/map | 9 ++-
libcxx/include/math.h | 7 +-
libcxx/include/mdspan | 7 +-
libcxx/include/memory | 7 +-
libcxx/include/memory_resource | 7 +-
libcxx/include/mutex | 7 +-
libcxx/include/new | 7 +-
libcxx/include/numbers | 7 +-
libcxx/include/numeric | 7 +-
libcxx/include/optional | 7 +-
libcxx/include/ostream | 7 +-
libcxx/include/print | 7 +-
libcxx/include/queue | 7 +-
libcxx/include/random | 7 +-
libcxx/include/ranges | 7 +-
libcxx/include/ratio | 7 +-
libcxx/include/regex | 7 +-
libcxx/include/scoped_allocator | 7 +-
libcxx/include/semaphore | 7 +-
libcxx/include/set | 9 ++-
libcxx/include/shared_mutex | 7 +-
libcxx/include/source_location | 7 +-
libcxx/include/span | 7 +-
libcxx/include/sstream | 7 +-
libcxx/include/stack | 7 +-
libcxx/include/stdatomic.h | 7 +-
libcxx/include/stdbool.h | 7 +-
libcxx/include/stddef.h | 7 +-
libcxx/include/stdexcept | 7 +-
libcxx/include/stdio.h | 7 +-
libcxx/include/stdlib.h | 7 +-
libcxx/include/stop_token | 7 +-
libcxx/include/streambuf | 7 +-
libcxx/include/string | 7 +-
libcxx/include/string.h | 7 +-
libcxx/include/string_view | 7 +-
libcxx/include/strstream | 7 +-
libcxx/include/syncstream | 7 +-
libcxx/include/system_error | 7 +-
libcxx/include/tgmath.h | 7 +-
libcxx/include/thread | 7 +-
libcxx/include/tuple | 7 +-
libcxx/include/type_traits | 7 +-
libcxx/include/typeindex | 7 +-
libcxx/include/typeinfo | 7 +-
libcxx/include/uchar.h | 7 +-
libcxx/include/unordered_map | 7 +-
libcxx/include/unordered_set | 7 +-
libcxx/include/utility | 7 +-
libcxx/include/valarray | 7 +-
libcxx/include/variant | 7 +-
libcxx/include/vector | 7 +-
libcxx/include/version | 13 ++-
libcxx/include/wchar.h | 7 +-
libcxx/include/wctype.h | 7 +-
.../libcxx/algorithms/half_positive.pass.cpp | 2 +
...customize_verbose_abort.link-time.pass.cpp | 2 +
.../assertions/default_verbose_abort.pass.cpp | 2 +
.../libcxx/assertions/modes/none.pass.cpp | 2 +
.../assertions/single_expression.pass.cpp | 2 +
...compatible_with_stdatomic.compile.pass.cpp | 2 +
.../test/libcxx/clang_modules_include.gen.py | 2 +
.../tree_balance_after_insert.pass.cpp | 2 +
.../tree_key_value_traits.pass.cpp | 2 +
.../associative/tree_left_rotate.pass.cpp | 2 +
.../associative/tree_remove.pass.cpp | 2 +
.../associative/tree_right_rotate.pass.cpp | 2 +
.../unord.map/abi.compile.pass.cpp | 2 +
.../unord.set/abi.compile.pass.cpp | 2 +
.../container_traits.compile.pass.cpp | 2 +
.../unord/key_value_traits.pass.cpp | 2 +
.../containers/unord/next_pow2.pass.cpp | 2 +
.../containers/unord/next_prime.pass.cpp | 2 +
.../depr/depr.c.headers/extern_c.pass.cpp | 2 +
libcxx/test/libcxx/header_inclusions.gen.py | 3 +
.../filebuf/traits_mismatch.verify.cpp | 2 +
.../fstreams/traits_mismatch.verify.cpp | 2 +
.../input.streams/traits_mismatch.verify.cpp | 2 +
.../output.streams/traits_mismatch.verify.cpp | 2 +
.../stringbuf/const_sso_buffer.pass.cpp | 2 +
.../string.streams/traits_mismatch.verify.cpp | 2 +
.../iterators/aliasing_iterator.pass.cpp | 2 +
.../bounded_iter/arithmetic.pass.cpp | 2 +
.../bounded_iter/comparison.pass.cpp | 2 +
.../bounded_iter/pointer_traits.pass.cpp | 2 +
.../bounded_iter/types.compile.pass.cpp | 2 +
...contiguous_iterators.conv.compile.pass.cpp | 2 +
.../iterators/contiguous_iterators.verify.cpp | 2 +
.../iterator.operations/prev.verify.cpp | 2 +
.../support.dynamic/libcpp_deallocate.sh.cpp | 2 +
.../libcxx/memory/allocation_guard.pass.cpp | 2 +
.../libcxx/memory/swap_allocator.pass.cpp | 2 +
libcxx/test/libcxx/numerics/bit.ops.pass.cpp | 2 +
.../numerics/clamp_to_integral.pass.cpp | 2 +
.../complex.number/cmplx.over.pow.pass.cpp | 2 +
.../test/libcxx/selftest/test_macros.pass.cpp | 3 +
.../c.strings/constexpr_memmove.pass.cpp | 2 +
libcxx/test/libcxx/transitive_includes.gen.py | 2 +
.../type_traits/datasizeof.compile.pass.cpp | 2 +
.../is_constant_evaluated.pass.cpp | 2 +
.../is_trivially_comparable.compile.pass.cpp | 2 +
.../is_trivially_relocatable.compile.pass.cpp | 2 +
.../utilities/exception_guard.odr.sh.cpp | 2 +
.../utilities/is_pointer_in_range.pass.cpp | 2 +
.../libcxx/utilities/is_valid_range.pass.cpp | 2 +
.../libcxx/utilities/meta/meta_base.pass.cpp | 2 +
.../test/libcxx/utilities/no_destroy.pass.cpp | 2 +
.../template.bitset/includes.pass.cpp | 2 +
.../private_constructor_tag.compile.pass.cpp | 2 +
.../array/array.fill/fill.verify.cpp | 2 +
.../array/array.swap/swap.verify.cpp | 2 +
.../array/array.tuple/get.verify.cpp | 2 +
.../array.tuple/tuple_element.verify.cpp | 2 +
.../array/size_and_alignment.compile.pass.cpp | 2 +
.../sequences/forwardlist/types.pass.cpp | 2 +
.../containers/sequences/list/types.pass.cpp | 2 +
.../vector/vector.cons/exceptions.pass.cpp | 2 +
.../vector.modifiers/erase_iter.pass.cpp | 2 +
.../vector.modifiers/erase_iter_iter.pass.cpp | 2 +
.../fstreams/fstream.cons/default.pass.cpp | 2 +
.../fstreams/fstream.cons/move.pass.cpp | 2 +
.../fstreams/fstream.cons/pointer.pass.cpp | 2 +
.../fstreams/fstream.cons/string.pass.cpp | 2 +
.../fstreams/ifstream.cons/default.pass.cpp | 2 +
.../fstreams/ifstream.cons/move.pass.cpp | 2 +
.../fstreams/ifstream.cons/pointer.pass.cpp | 2 +
.../fstreams/ifstream.cons/string.pass.cpp | 2 +
.../fstreams/ofstream.cons/default.pass.cpp | 2 +
.../fstreams/ofstream.cons/move.pass.cpp | 2 +
.../fstreams/ofstream.cons/pointer.pass.cpp | 2 +
.../fstreams/ofstream.cons/string.pass.cpp | 2 +
.../istringstream.cons/default.pass.cpp | 2 +
.../istringstream.cons/move.pass.cpp | 2 +
.../istringstream.cons/string.pass.cpp | 2 +
.../ostringstream.cons/default.pass.cpp | 2 +
.../ostringstream.cons/move.pass.cpp | 2 +
.../ostringstream.cons/string.pass.cpp | 2 +
.../stringbuf/stringbuf.cons/default.pass.cpp | 2 +
.../stringstream.cons/default.pass.cpp | 2 +
.../stringstream.cons/move.pass.cpp | 2 +
.../stringstream.cons/string.pass.cpp | 2 +
.../cstdalign.compile.pass.cpp | 2 +
.../std/numerics/c.math/isnormal.pass.cpp | 2 +
.../test/std/numerics/c.math/signbit.pass.cpp | 2 +
.../std/re/re.alg/re.alg.match/awk.pass.cpp | 2 +
.../std/re/re.alg/re.alg.match/basic.pass.cpp | 2 +
.../std/re/re.alg/re.alg.match/ecma.pass.cpp | 2 +
.../std/re/re.alg/re.alg.match/egrep.pass.cpp | 2 +
.../re/re.alg/re.alg.match/extended.pass.cpp | 2 +
.../std/re/re.alg/re.alg.match/grep.pass.cpp | 2 +
.../re.alg.match/lookahead_capture.pass.cpp | 2 +
.../parse_curly_brackets.pass.cpp | 2 +
.../re.alg.replace/exponential.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test1.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test2.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test3.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test4.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test5.pass.cpp | 2 +
.../re/re.alg/re.alg.replace/test6.pass.cpp | 2 +
.../zero_length_matches.pass.cpp | 2 +
.../std/re/re.alg/re.alg.search/awk.pass.cpp | 2 +
.../re/re.alg/re.alg.search/backup.pass.cpp | 2 +
.../re/re.alg/re.alg.search/basic.pass.cpp | 2 +
.../std/re/re.alg/re.alg.search/ecma.pass.cpp | 2 +
.../re/re.alg/re.alg.search/egrep.pass.cpp | 2 +
.../re/re.alg/re.alg.search/extended.pass.cpp | 2 +
.../std/re/re.alg/re.alg.search/grep.pass.cpp | 2 +
.../invert_neg_word_search.pass.cpp | 2 +
.../re.alg/re.alg.search/lookahead.pass.cpp | 2 +
.../re.alg.search/no_update_pos.pass.cpp | 2 +
.../re.matchflag/match_not_bol.pass.cpp | 2 +
.../re.matchflag/match_not_eol.pass.cpp | 2 +
.../re.matchflag/match_not_null.pass.cpp | 2 +
.../re.matchflag/match_prev_avail.pass.cpp | 2 +
.../re.regiter.cnstr/cnstr.pass.cpp | 2 +
.../re.regiter.deref/deref.pass.cpp | 2 +
.../re.regiter/re.regiter.incr/post.pass.cpp | 2 +
.../re.tokiter.cnstr/array.pass.cpp | 2 +
.../re.tokiter/re.tokiter.cnstr/init.pass.cpp | 2 +
.../re.tokiter/re.tokiter.cnstr/int.pass.cpp | 2 +
.../re.tokiter.cnstr/vector.pass.cpp | 2 +
.../re.tokiter/re.tokiter.comp/equal.pass.cpp | 2 +
.../re.tokiter.deref/deref.pass.cpp | 2 +
.../re.tokiter/re.tokiter.incr/post.pass.cpp | 2 +
.../re.regex/re.regex.assign/assign.pass.cpp | 2 +
.../assign_iter_iter_flag.pass.cpp | 2 +
.../re.regex.assign/assign_ptr_flag.pass.cpp | 2 +
.../assign_ptr_size_flag.pass.cpp | 2 +
.../assign_string_flag.pass.cpp | 2 +
.../re/re.regex/re.regex.assign/copy.pass.cpp | 2 +
.../re/re.regex/re.regex.assign/ptr.pass.cpp | 2 +
.../re.regex/re.regex.assign/string.pass.cpp | 2 +
.../re.regex.construct/awk_oct.pass.cpp | 2 +
.../re.regex.construct/bad_backref.pass.cpp | 2 +
.../re.regex.construct/bad_ctype.pass.cpp | 2 +
.../re.regex.construct/bad_escape.pass.cpp | 2 +
.../re.regex.construct/bad_range.pass.cpp | 2 +
.../re.regex.construct/bad_repeat.pass.cpp | 2 +
.../re.regex/re.regex.construct/copy.pass.cpp | 2 +
.../re.regex.construct/iter_iter.pass.cpp | 2 +
.../re.regex.construct/iter_iter_flg.pass.cpp | 2 +
.../re.regex/re.regex.construct/ptr.pass.cpp | 2 +
.../re.regex.construct/ptr_flg.pass.cpp | 2 +
.../re.regex.construct/ptr_size.pass.cpp | 2 +
.../re.regex.construct/ptr_size_flg.pass.cpp | 2 +
.../re.regex.construct/string.pass.cpp | 2 +
.../re.regex.construct/string_flg.pass.cpp | 2 +
.../re.regex.nmswap/swap.pass.cpp | 2 +
.../re/re.regex/re.regex.swap/swap.pass.cpp | 2 +
.../re.results.acc/begin_end.pass.cpp | 2 +
.../re.results.acc/cbegin_cend.pass.cpp | 2 +
.../re.results/re.results.acc/index.pass.cpp | 2 +
.../re.results/re.results.acc/length.pass.cpp | 2 +
.../re.results.acc/position.pass.cpp | 2 +
.../re.results/re.results.acc/prefix.pass.cpp | 2 +
.../re/re.results/re.results.acc/str.pass.cpp | 2 +
.../re.results/re.results.acc/suffix.pass.cpp | 2 +
.../re.results/re.results.form/form1.pass.cpp | 2 +
.../re.results/re.results.form/form2.pass.cpp | 2 +
.../re.results/re.results.form/form3.pass.cpp | 2 +
.../re.results/re.results.form/form4.pass.cpp | 2 +
.../re.results.nonmember/equal.pass.cpp | 2 +
.../re.results/re.results.size/empty.pass.cpp | 2 +
.../re.results.state/ready.pass.cpp | 2 +
.../re.results.swap/member_swap.pass.cpp | 2 +
.../re.results.swap/non_member_swap.pass.cpp | 2 +
.../strings/basic.string/char.bad.verify.cpp | 2 +
.../strings/string.view/char.bad.verify.cpp | 2 +
.../nonstdmem.uglified.compile.pass.cpp | 2 +
libcxx/test/support/test_macros.h | 32 ++++++--
.../proper_version_checks.cpp | 3 +
libcxx/utils/ci/run-buildbot | 6 ++
.../generate_feature_test_macro_components.py | 12 ++-
libcxx/utils/libcxx/test/params.py | 7 ++
.../vendor/llvm/default_assertion_handler.in | 9 ++-
326 files changed, 1049 insertions(+), 470 deletions(-)
create mode 100644 libcxx/cmake/caches/frozen-cxx03-headers.cmake
create mode 100644 libcxx/include/__cxx03/__configuration/config_site_shim.h
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index cba8afbb54f0f0..216af8ef2216e6 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -43,6 +43,7 @@ jobs:
fail-fast: false
matrix:
config: [
+ 'frozen-cxx03-headers',
'generic-cxx03',
'generic-cxx26',
'generic-modules'
diff --git a/libcxx/cmake/caches/frozen-cxx03-headers.cmake b/libcxx/cmake/caches/frozen-cxx03-headers.cmake
new file mode 100644
index 00000000000000..dfd158bf6edbe5
--- /dev/null
+++ b/libcxx/cmake/caches/frozen-cxx03-headers.cmake
@@ -0,0 +1,2 @@
+set(LIBCXX_TEST_PARAMS "std=c++03;test_frozen_cxx03_headers=True" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 561ce4b42fb250..2002e27aa55718 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -1047,12 +1047,15 @@ set(files
wctype.h
)
+add_subdirectory(__cxx03)
+
configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
configure_file("${LIBCXX_ASSERTION_HANDLER_FILE}" "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler" COPYONLY)
set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site"
"${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler")
-foreach(f ${files})
+message(STATUS "C++03 headers: ${LIBCXX_FROZEN_CXX03_HEADERS}")
+foreach(f ${files} ${LIBCXX_FROZEN_CXX03_HEADERS})
set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}")
add_custom_command(OUTPUT ${dst}
@@ -1082,7 +1085,7 @@ target_include_directories(cxx-headers INTERFACE ${LIBCXX_GENERATED_INCLUDE_TARG
${LIBCXX_GENERATED_INCLUDE_DIR})
if (LIBCXX_INSTALL_HEADERS)
- foreach(file ${files})
+ foreach(file ${files} ${LIBCXX_FROZEN_CXX03_HEADERS})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file}
DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}/${dir}"
diff --git a/libcxx/include/__cxx03/CMakeLists.txt b/libcxx/include/__cxx03/CMakeLists.txt
index b61442da89d4bf..52241cf12c421f 100644
--- a/libcxx/include/__cxx03/CMakeLists.txt
+++ b/libcxx/include/__cxx03/CMakeLists.txt
@@ -318,6 +318,7 @@ set(files
__configuration/abi.h
__configuration/availability.h
__configuration/compiler.h
+ __configuration/config_site_shim.h
__configuration/language.h
__configuration/platform.h
__coroutine/coroutine_handle.h
@@ -1018,14 +1019,10 @@ set(files
wctype.h
)
-configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
-configure_file("${LIBCXX_ASSERTION_HANDLER_FILE}" "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler" COPYONLY)
-
-set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site"
- "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler")
+set(_all_includes "")
foreach(f ${files})
set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
- set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}")
+ set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/__cxx03/${f}")
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
@@ -1033,60 +1030,23 @@ foreach(f ${files})
list(APPEND _all_includes "${dst}")
endforeach()
-# Generate the IWYU mapping. This depends on all header files but it's also considered as an
-# "include" for dependency tracking.
-add_custom_command(OUTPUT "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
- COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_iwyu_mapping.py" "-o" "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
- DEPENDS "${LIBCXX_SOURCE_DIR}/utils/libcxx/header_information.py"
- COMMENT "Generate the mapping file for include-what-you-use"
-)
-list(APPEND _all_includes "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp")
-
-add_custom_target(generate-cxx-headers ALL DEPENDS ${_all_includes})
-
-add_library(cxx-headers INTERFACE)
-target_link_libraries(cxx-headers INTERFACE libcxx-libc-headers libcxx-abi-headers)
-add_dependencies(cxx-headers generate-cxx-headers)
-# It's important that the arch directory be included first so that its header files
-# which interpose on the default include dir be included instead of the default ones.
-target_include_directories(cxx-headers INTERFACE ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}
- ${LIBCXX_GENERATED_INCLUDE_DIR})
+add_custom_target(generate-frozen-cxx03-headers ALL DEPENDS ${_all_includes})
if (LIBCXX_INSTALL_HEADERS)
foreach(file ${files})
get_filename_component(dir ${file} DIRECTORY)
- install(FILES ${file}
- DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}/${dir}"
+ install(FILES "${file}"
+ DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}/__cxx03/${dir}"
COMPONENT cxx-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endforeach()
- # Install the generated __config_site file to the per-target include dir.
- install(FILES "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site"
- DESTINATION "${LIBCXX_INSTALL_INCLUDE_TARGET_DIR}"
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
- COMPONENT cxx-headers)
-
- # Install the generated __assertion_handler file to the generic include dir.
- install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler"
- DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}"
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
- COMPONENT cxx-headers)
-
- # Install the generated IWYU file to the generic include dir.
- install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp"
- DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}"
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
- COMPONENT cxx-headers)
-
if (NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-cxx-headers
+ add_custom_target(install-frozen-cxx03-headers
DEPENDS cxx-headers
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx-headers
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
- # Stripping is a no-op for headers
- add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
endif()
endif()
diff --git a/libcxx/include/__cxx03/__config b/libcxx/include/__cxx03/__config
index 935fa4cc404f4e..76e6fd7f40d057 100644
--- a/libcxx/include/__cxx03/__config
+++ b/libcxx/include/__cxx03/__config
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___CXX03___CONFIG
#define _LIBCPP___CXX03___CONFIG
-#include <__config_site>
+#include <__cxx03/__configuration/config_site_shim.h>
#include <__cxx03/__configuration/abi.h>
#include <__cxx03/__configuration/availability.h>
#include <__cxx03/__configuration/compiler.h>
diff --git a/libcxx/include/__cxx03/__configuration/abi.h b/libcxx/include/__cxx03/__configuration/abi.h
index 9e7f7313c8834f..740aec39a3487a 100644
--- a/libcxx/include/__cxx03/__configuration/abi.h
+++ b/libcxx/include/__cxx03/__configuration/abi.h
@@ -10,8 +10,8 @@
#ifndef _LIBCPP___CXX03___CONFIGURATION_ABI_H
#define _LIBCPP___CXX03___CONFIGURATION_ABI_H
-#include <__config_site>
#include <__cxx03/__configuration/compiler.h>
+#include <__cxx03/__configuration/config_site_shim.h>
#include <__cxx03/__configuration/platform.h>
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
diff --git a/libcxx/include/__cxx03/__configuration/compiler.h b/libcxx/include/__cxx03/__configuration/compiler.h
index 2f33fb1f6ef4d4..4d53a2144a5012 100644
--- a/libcxx/include/__cxx03/__configuration/compiler.h
+++ b/libcxx/include/__cxx03/__configuration/compiler.h
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___CXX03___CONFIGURATION_COMPILER_H
#define _LIBCPP___CXX03___CONFIGURATION_COMPILER_H
-#include <__config_site>
+#include <__cxx03/__configuration/config_site_shim.h>
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__configuration/config_site_shim.h b/libcxx/include/__cxx03/__configuration/config_site_shim.h
new file mode 100644
index 00000000000000..e9c8604ed81c5b
--- /dev/null
+++ b/libcxx/include/__cxx03/__configuration/config_site_shim.h
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// 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___CXX03___CONFIGURATION_CONFIG_SITE_WRAPPER_H
+#define _LIBCPP___CXX03___CONFIGURATION_CONFIG_SITE_WRAPPER_H
+
+#include <__config_site>
+
+#if !_LIBCPP_ABI_FORCE_ITANIUM
+# undef _LIBCPP_ABI_FORCE_ITANIUM
+#endif
+
+#if !_LIBCPP_ABI_FORCE_MICROSOFT
+# undef _LIBCPP_ABI_FORCE_MICROSOFT
+#endif
+
+#if !_LIBCPP_HAS_THREADS
+# define _LIBCPP_HAS_NO_THREADS
+#endif
+
+#if !_LIBCPP_HAS_MONOTONIC_CLOCK
+# define _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+#endif
+
+#if !_LIBCPP_HAS_MUSL_LIBC
+# undef _LIBCPP_HAS_MUSL_LIBC
+#endif
+
+#if !_LIBCPP_HAS_THREAD_API_PTHREAD
+# undef _LIBCPP_HAS_THREAD_API_PTHREAD
+#endif
+
+#if !_LIBCPP_HAS_THREAD_API_EXTERNAL
+# undef _LIBCPP_HAS_THREAD_API_EXTERNAL
+#endif
+
+#if !_LIBCPP_HAS_THREAD_API_WIN32
+# undef _LIBCPP_HAS_THREAD_API_WIN32
+#endif
+
+#undef _LIBCPP_HAS_THREAD_API_C11
+
+#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS
+# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
+#endif
+
+#if !_LIBCPP_HAS_FILESYSTEM
+# define _LIBCPP_HAS_NO_FILESYSTEM
+#endif
+
+#if !_LIBCPP_HAS_RANDOM_DEVICE
+# define _LIBCPP_HAS_NO_RANDOM_DEVICE
+#endif
+
+#if !_LIBCPP_HAS_LOCALIZATION
+# define _LIBCPP_HAS_NO_LOCALIZATION
+#endif
+
+#if !_LIBCPP_HAS_UNICODE
+# define _LIBCPP_HAS_NO_UNICODE
+#endif
+
+#if !_LIBCPP_HAS_WIDE_CHARACTERS
+# define _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#endif
+
+#if !_LIBCPP_HAS_TIME_ZONE_DATABASE
+# define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE
+#endif
+
+#if !_LIBCPP_INSTRUMENTED_WITH_ASAN
+# undef _LIBCPP_INSTRUMENTED_WITH_ASAN
+#endif
+
+#endif // _LIBCPP___CXX03___CONFIGURATION_CONFIG_SITE_WRAPPER_H
diff --git a/libcxx/include/__cxx03/__configuration/language.h b/libcxx/include/__cxx03/__configuration/language.h
index 604f2d2cd532a8..8fd09f4b225540 100644
--- a/libcxx/include/__cxx03/__configuration/language.h
+++ b/libcxx/include/__cxx03/__configuration/language.h
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___CXX03___CONFIGURATION_LANGUAGE_H
#define _LIBCPP___CXX03___CONFIGURATION_LANGUAGE_H
-#include <__config_site>
+#include <__cxx03/__configuration/config_site_shim.h>
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__configuration/platform.h b/libcxx/include/__cxx03/__configuration/platform.h
index b4718986ad10d8..24590503693aeb 100644
--- a/libcxx/include/__cxx03/__configuration/platform.h
+++ b/libcxx/include/__cxx03/__configuration/platform.h
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H
#define _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H
-#include <__config_site>
+#include <__cxx03/__configuration/config_site_shim.h>
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h b/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
index e61e950a42c77c..36fe5aed6c5864 100644
--- a/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
+++ b/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h
@@ -15,7 +15,7 @@
#include <__cxx03/__locale_dir/locale_base_api/locale_guard.h>
#include <__cxx03/cstdio>
-#include <__cxx03/stdarg.h>
+#include <stdarg.h>
#include <__cxx03/stdlib.h>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
diff --git a/libcxx/include/__cxx03/__thread/support/pthread.h b/libcxx/include/__cxx03/__thread/support/pthread.h
index a4d7c874e68306..4dc7a4980de2b5 100644
--- a/libcxx/include/__cxx03/__thread/support/pthread.h
+++ b/libcxx/include/__cxx03/__thread/support/pthread.h
@@ -15,8 +15,8 @@
#include <__cxx03/__config>
#include <__cxx03/ctime>
#include <__cxx03/errno.h>
-#include <__cxx03/pthread.h>
-#include <__cxx03/sched.h>
+#include <pthread.h>
+#include <sched.h>
#ifdef __MVS__
# include <__cxx03/__support/ibm/nanosleep.h>
diff --git a/libcxx/include/__cxx03/climits b/libcxx/include/__cxx03/climits
index 37d8c41a0c6de7..2c6fe5ab95b4b2 100644
--- a/libcxx/include/__cxx03/climits
+++ b/libcxx/include/__cxx03/climits
@@ -39,7 +39,7 @@ Macros:
#include <__cxx03/__config>
-#include <__cxx03/limits.h>
+#include <limits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/locale b/libcxx/include/__cxx03/locale
index 78c0fd7763af24..6360bbc2f6b608 100644
--- a/libcxx/include/__cxx03/locale
+++ b/libcxx/include/__cxx03/locale
@@ -222,7 +222,7 @@ template <class charT> class messages_byname;
// Most unix variants have catopen. These are the specific ones that don't.
# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
# define _LIBCPP_HAS_CATOPEN 1
-# include <__cxx03/nl_types.h>
+# include <nl_types.h>
# endif
# endif
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 080fca8c1ca517..e593ae26ed6e24 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1827,8 +1827,9 @@ template <class BidirectionalIterator, class Compare>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/algorithm>
+#else
# include <__config>
# include <__algorithm/adjacent_find.h>
@@ -2056,6 +2057,6 @@ template <class BidirectionalIterator, class Compare>
# include <type_traits>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ALGORITHM
diff --git a/libcxx/include/any b/libcxx/include/any
index c8658a468713ce..934c4dbd45a68e 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -80,8 +80,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/any>
+#else
# include <__config>
# include <__memory/allocator.h>
# include <__memory/allocator_destructor.h>
@@ -611,6 +612,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <variant>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ANY
diff --git a/libcxx/include/array b/libcxx/include/array
index b65b99533cbeb6..a669bf0272d6f7 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -111,8 +111,9 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/array>
+#else
# include <__algorithm/equal.h>
# include <__algorithm/fill_n.h>
# include <__algorithm/lexicographical_compare.h>
@@ -566,6 +567,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ARRAY
diff --git a/libcxx/include/atomic b/libcxx/include/atomic
index 64635d099af92f..80f9e437bfaab0 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -587,8 +587,9 @@ template <class T>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/atomic>
+#else
# include <__config>
# include <__atomic/aliases.h>
@@ -625,6 +626,6 @@ template <class T>
# include <cstring>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ATOMIC
diff --git a/libcxx/include/barrier b/libcxx/include/barrier
index 705cb7d9ac52e1..6861532b02ba23 100644
--- a/libcxx/include/barrier
+++ b/libcxx/include/barrier
@@ -45,8 +45,9 @@ namespace std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/barrier>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -306,6 +307,6 @@ _LIBCPP_POP_MACROS
# include <stdexcept>
# include <variant>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_BARRIER
diff --git a/libcxx/include/bit b/libcxx/include/bit
index a5a317ebb232b2..3fea10ba25c4df 100644
--- a/libcxx/include/bit
+++ b/libcxx/include/bit
@@ -61,8 +61,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/bit>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -95,6 +96,6 @@ namespace std {
# include <limits>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_BIT
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index e2dc7b459f1c4a..8b361824805571 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -126,8 +126,9 @@ template <size_t N> struct hash<std::bitset<N>>;
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/bitset>
+#else
# include <__algorithm/count.h>
# include <__algorithm/fill.h>
# include <__algorithm/fill_n.h>
@@ -971,6 +972,6 @@ _LIBCPP_POP_MACROS
# include <cstdlib>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_BITSET
diff --git a/libcxx/include/cassert b/libcxx/include/cassert
index 18e6e29353362d..9d3cd77fcf2d76 100644
--- a/libcxx/include/cassert
+++ b/libcxx/include/cassert
@@ -16,8 +16,9 @@ Macros:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cassert>
+#else
# include <__config>
// <assert.h> is not provided by libc++
@@ -31,4 +32,4 @@ Macros:
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
diff --git a/libcxx/include/ccomplex b/libcxx/include/ccomplex
index bd5a811b7e9fb9..10eb8a36e417c5 100644
--- a/libcxx/include/ccomplex
+++ b/libcxx/include/ccomplex
@@ -17,8 +17,9 @@
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ccomplex>
+#else
# include <complex>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -36,6 +37,6 @@ using __standard_header_ccomplex _LIBCPP_DEPRECATED_("Include <complex> instead.
using __use_standard_header_ccomplex = __standard_header_ccomplex;
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CCOMPLEX
diff --git a/libcxx/include/cctype b/libcxx/include/cctype
index ee3002b2cc5fed..abe0ec44e3a642 100644
--- a/libcxx/include/cctype
+++ b/libcxx/include/cctype
@@ -34,8 +34,9 @@ int toupper(int c);
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cctype>
+#else
# include <__config>
# include <ctype.h>
@@ -125,6 +126,6 @@ using ::tolower _LIBCPP_USING_IF_EXISTS;
using ::toupper _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CCTYPE
diff --git a/libcxx/include/cerrno b/libcxx/include/cerrno
index 63017d07c019ab..15925d4381095b 100644
--- a/libcxx/include/cerrno
+++ b/libcxx/include/cerrno
@@ -22,8 +22,9 @@ Macros:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cerrno>
+#else
# include <__config>
# include <errno.h>
@@ -46,6 +47,6 @@ Macros:
// deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542.
// Based on the post commit feedback the macro are no longer deprecated.
// Instead libc++ leaves the deprecation to the provider of errno.h.
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CERRNO
diff --git a/libcxx/include/cfenv b/libcxx/include/cfenv
index 47ed700f4bee61..d7ea770297530c 100644
--- a/libcxx/include/cfenv
+++ b/libcxx/include/cfenv
@@ -52,8 +52,9 @@ int feupdateenv(const fenv_t* envp);
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cfenv>
+#else
# include <__config>
# include <fenv.h>
@@ -86,8 +87,9 @@ using ::fegetenv _LIBCPP_USING_IF_EXISTS;
using ::feholdexcept _LIBCPP_USING_IF_EXISTS;
using ::fesetenv _LIBCPP_USING_IF_EXISTS;
using ::feupdateenv _LIBCPP_USING_IF_EXISTS;
-#endif // 0
_LIBCPP_END_NAMESPACE_STD
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+
#endif // _LIBCPP_CFENV
diff --git a/libcxx/include/cfloat b/libcxx/include/cfloat
index fc37f58f4f12c4..18b4afd28ee87b 100644
--- a/libcxx/include/cfloat
+++ b/libcxx/include/cfloat
@@ -69,8 +69,9 @@ Macros:
LDBL_TRUE_MIN // C11
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cfloat>
+#else
# include <__config>
# include <float.h>
@@ -86,6 +87,6 @@ Macros:
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CFLOAT
diff --git a/libcxx/include/charconv b/libcxx/include/charconv
index 7415f4a5182dc0..0ce1da14518aa6 100644
--- a/libcxx/include/charconv
+++ b/libcxx/include/charconv
@@ -75,8 +75,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/charconv>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 17
@@ -114,6 +115,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <limits>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CHARCONV
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index 6654a6776d3977..d9a8afef933b9b 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -939,8 +939,9 @@ constexpr chrono::year operator ""y(unsigned lo
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/chrono>
+#else
# include <__config>
# include <__chrono/duration.h>
@@ -1019,6 +1020,6 @@ constexpr chrono::year operator ""y(unsigned lo
# include <ostream>
# endif
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CHRONO
diff --git a/libcxx/include/cinttypes b/libcxx/include/cinttypes
index 053067d4d62502..4c7e2c5a5bf382 100644
--- a/libcxx/include/cinttypes
+++ b/libcxx/include/cinttypes
@@ -234,8 +234,9 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cinttypes>
+#else
# include <__config>
// standard-mandated includes
@@ -269,6 +270,6 @@ using ::wcstoumax _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CINTTYPES
diff --git a/libcxx/include/ciso646 b/libcxx/include/ciso646
index 965b78741a0b4b..5b956401430a78 100644
--- a/libcxx/include/ciso646
+++ b/libcxx/include/ciso646
@@ -15,8 +15,9 @@
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ciso646>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -29,6 +30,6 @@ using __standard_header_ciso646 _LIBCPP_DEPRECATED_("removed in C++20. Include <
using __use_standard_header_ciso646 = __standard_header_ciso646;
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CISO646
diff --git a/libcxx/include/climits b/libcxx/include/climits
index b31f77d9e859d1..a051d964bbce95 100644
--- a/libcxx/include/climits
+++ b/libcxx/include/climits
@@ -37,8 +37,9 @@ Macros:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/climits>
+#else
# include <__config>
# include <limits.h>
@@ -47,6 +48,6 @@ Macros:
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CLIMITS
diff --git a/libcxx/include/clocale b/libcxx/include/clocale
index 4199487a3992f3..9ca82fa15be254 100644
--- a/libcxx/include/clocale
+++ b/libcxx/include/clocale
@@ -34,8 +34,9 @@ lconv* localeconv();
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/clocale>
+#else
# include <__config>
# if __has_include(<locale.h>)
@@ -54,6 +55,6 @@ using ::localeconv _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CLOCALE
diff --git a/libcxx/include/cmath b/libcxx/include/cmath
index ff8e7e1bf14819..9cf044d4d023be 100644
--- a/libcxx/include/cmath
+++ b/libcxx/include/cmath
@@ -312,8 +312,9 @@ constexpr long double lerp(long double a, long double b, long double t) noexcept
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cmath>
+#else
# include <__config>
# include <__math/hypot.h>
# include <__type_traits/enable_if.h>
@@ -616,6 +617,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CMATH
diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index ce6d995f37aba9..f7ae804c6789c5 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -54,8 +54,9 @@ class codecvt_utf8_utf16
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/codecvt>
+#else
# include <__config>
# include <__locale>
# include <version>
@@ -595,6 +596,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CODECVT
diff --git a/libcxx/include/compare b/libcxx/include/compare
index 97871e679bf32e..0c19a5bb5f8106 100644
--- a/libcxx/include/compare
+++ b/libcxx/include/compare
@@ -140,8 +140,9 @@ namespace std {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/compare>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -171,6 +172,6 @@ namespace std {
# include <cstddef>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_COMPARE
diff --git a/libcxx/include/complex b/libcxx/include/complex
index bfc27bb3834163..bc73f313c2ce16 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -256,8 +256,9 @@ template<class T> complex<T> tanh (const complex<T>&);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/complex>
+#else
# include <__config>
# include <__fwd/complex.h>
# include <__fwd/tuple.h>
@@ -1476,6 +1477,6 @@ _LIBCPP_POP_MACROS
# include <stdexcept>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_COMPLEX
diff --git a/libcxx/include/complex.h b/libcxx/include/complex.h
index 5bc7ab435ca725..8a1f92689601f4 100644
--- a/libcxx/include/complex.h
+++ b/libcxx/include/complex.h
@@ -17,8 +17,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/complex.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -30,6 +31,6 @@
# elif __has_include_next(<complex.h>)
# include_next <complex.h>
# endif
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_COMPLEX_H
diff --git a/libcxx/include/concepts b/libcxx/include/concepts
index 2fe5400c2c715a..ff3fd153a38d5e 100644
--- a/libcxx/include/concepts
+++ b/libcxx/include/concepts
@@ -129,8 +129,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/concepts>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -168,6 +169,6 @@ namespace std {
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CONCEPTS
diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable
index f351f13b713893..81699bf6adbf74 100644
--- a/libcxx/include/condition_variable
+++ b/libcxx/include/condition_variable
@@ -118,8 +118,9 @@ public:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/condition_variable>
+#else
# include <__chrono/duration.h>
# include <__chrono/steady_clock.h>
# include <__chrono/time_point.h>
@@ -367,6 +368,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CONDITION_VARIABLE
diff --git a/libcxx/include/coroutine b/libcxx/include/coroutine
index c39aa9a3da0ce2..d745844da8e9d1 100644
--- a/libcxx/include/coroutine
+++ b/libcxx/include/coroutine
@@ -38,8 +38,9 @@ struct suspend_always;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/coroutine>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -66,6 +67,6 @@ struct suspend_always;
# include <limits>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_COROUTINE
diff --git a/libcxx/include/csetjmp b/libcxx/include/csetjmp
index bd512720be0080..39ab035a5f3848 100644
--- a/libcxx/include/csetjmp
+++ b/libcxx/include/csetjmp
@@ -30,8 +30,9 @@ void longjmp(jmp_buf env, int val);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/csetjmp>
+#else
# include <__config>
// <setjmp.h> is not provided by libc++
@@ -53,6 +54,6 @@ using ::longjmp _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSETJMP
diff --git a/libcxx/include/csignal b/libcxx/include/csignal
index 92edf08f683e71..a15d17d3169da3 100644
--- a/libcxx/include/csignal
+++ b/libcxx/include/csignal
@@ -39,8 +39,9 @@ int raise(int sig);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/csignal>
+#else
# include <__config>
// <signal.h> is not provided by libc++
@@ -63,6 +64,6 @@ using ::raise _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSIGNAL
diff --git a/libcxx/include/cstdalign b/libcxx/include/cstdalign
index ab78344cd36c66..6a277e4673003b 100644
--- a/libcxx/include/cstdalign
+++ b/libcxx/include/cstdalign
@@ -20,8 +20,9 @@ Macros:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/__config>
+#else
# include <__config>
// <stdalign.h> is not provided by libc++
@@ -53,6 +54,6 @@ using __standard_header_cstdalign _LIBCPP_DEPRECATED = void;
using __use_standard_header_cstdalign = __standard_header_cstdalign;
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDALIGN
diff --git a/libcxx/include/cstdarg b/libcxx/include/cstdarg
index 1930fc95cf8512..069fe100880a2a 100644
--- a/libcxx/include/cstdarg
+++ b/libcxx/include/cstdarg
@@ -31,8 +31,9 @@ Types:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstdarg>
+#else
# include <__config>
// <stdarg.h> is not provided by libc++
@@ -53,6 +54,6 @@ using ::va_list _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDARG
diff --git a/libcxx/include/cstdbool b/libcxx/include/cstdbool
index a436c5c851a84a..a12954f07398cf 100644
--- a/libcxx/include/cstdbool
+++ b/libcxx/include/cstdbool
@@ -19,8 +19,9 @@ Macros:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstdbool>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -41,6 +42,6 @@ using __standard_header_cstdbool _LIBCPP_DEPRECATED = void;
using __use_standard_header_cstdbool = __standard_header_cstdbool;
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDBOOL
diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index 2e79d05243666d..d86d87bbbb9b50 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/include/cstddef
@@ -33,8 +33,9 @@ Types:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstddef>
+#else
# include <__config>
# include <version>
@@ -57,6 +58,6 @@ Types:
# include <__cstddef/nullptr_t.h>
# include <__cstddef/ptrdiff_t.h>
# include <__cstddef/size_t.h>
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDDEF
diff --git a/libcxx/include/cstdint b/libcxx/include/cstdint
index 594478930500c2..11839eeb071e5f 100644
--- a/libcxx/include/cstdint
+++ b/libcxx/include/cstdint
@@ -140,8 +140,9 @@ Types:
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstdint>
+#else
# include <__config>
# if __has_include(<stdint.h>)
@@ -192,6 +193,6 @@ using ::uintmax_t _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDINT
diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio
index 1b1a05d264b370..df9da1b4c87840 100644
--- a/libcxx/include/cstdio
+++ b/libcxx/include/cstdio
@@ -95,8 +95,9 @@ void perror(const char* s);
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstdio>
+#else
# include <__config>
# include <__cstddef/size_t.h>
@@ -173,6 +174,6 @@ using ::vprintf _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDIO
diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib
index 03e68957f71e47..adeee29b93fd72 100644
--- a/libcxx/include/cstdlib
+++ b/libcxx/include/cstdlib
@@ -81,8 +81,9 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstdlib>
+#else
# include <__config>
# include <__cstddef/size_t.h>
@@ -153,6 +154,6 @@ using ::aligned_alloc _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTDLIB
diff --git a/libcxx/include/cstring b/libcxx/include/cstring
index f4148858641061..4aa14feeec2809 100644
--- a/libcxx/include/cstring
+++ b/libcxx/include/cstring
@@ -56,8 +56,9 @@ size_t strlen(const char* s);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cstring>
+#else
# include <__config>
# include <__cstddef/size_t.h>
# include <__type_traits/is_constant_evaluated.h>
@@ -103,6 +104,6 @@ using ::strlen _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CSTRING
diff --git a/libcxx/include/ctgmath b/libcxx/include/ctgmath
index d8bb64032eca48..237f474f01c243 100644
--- a/libcxx/include/ctgmath
+++ b/libcxx/include/ctgmath
@@ -18,8 +18,9 @@
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ctgmath>
+#else
# include <cmath>
# include <complex>
@@ -39,6 +40,6 @@ using __use_standard_header_ctgmath = __standard_header_ctgmath;
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CTGMATH
diff --git a/libcxx/include/ctime b/libcxx/include/ctime
index 6c5b0166f9e427..1e845a8de0930c 100644
--- a/libcxx/include/ctime
+++ b/libcxx/include/ctime
@@ -45,8 +45,9 @@ int timespec_get( struct timespec *ts, int base); // C++17
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ctime>
+#else
# include <__config>
# include <__cstddef/size_t.h>
@@ -85,6 +86,6 @@ using ::timespec_get _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CTIME
diff --git a/libcxx/include/ctype.h b/libcxx/include/ctype.h
index 611f94036a1bd8..066f45018bbf57 100644
--- a/libcxx/include/ctype.h
+++ b/libcxx/include/ctype.h
@@ -29,8 +29,9 @@ int tolower(int c);
int toupper(int c);
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ctype.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -59,6 +60,6 @@ int toupper(int c);
# undef toupper
# endif
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CTYPE_H
diff --git a/libcxx/include/cuchar b/libcxx/include/cuchar
index 3ace72f1f8b1f6..38505eb336f847 100644
--- a/libcxx/include/cuchar
+++ b/libcxx/include/cuchar
@@ -36,8 +36,9 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cuchar>
+#else
# include <__config>
# include <__cstddef/size_t.h>
@@ -71,8 +72,9 @@ using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
# endif // _LIBCPP_CXX03_LANG
-#endif // 0
_LIBCPP_END_NAMESPACE_STD
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+
#endif // _LIBCPP_CUCHAR
diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar
index f97d9c43433a1f..4a4b052831a9ac 100644
--- a/libcxx/include/cwchar
+++ b/libcxx/include/cwchar
@@ -102,8 +102,9 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cwchar>
+#else
# include <__config>
# include <__cstddef/size_t.h>
# include <__type_traits/copy_cv.h>
@@ -259,6 +260,6 @@ _LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CWCHAR
diff --git a/libcxx/include/cwctype b/libcxx/include/cwctype
index 848aadd8a1d11d..b7f9cbb835e328 100644
--- a/libcxx/include/cwctype
+++ b/libcxx/include/cwctype
@@ -49,8 +49,9 @@ wctrans_t wctrans(const char* property);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/cwctype>
+#else
# include <__config>
# include <cctype>
@@ -96,6 +97,6 @@ using ::wctrans _LIBCPP_USING_IF_EXISTS;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_CWCTYPE
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 2bd850a67f07c1..db7b2f52f33146 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -177,8 +177,9 @@ template <class T, class Allocator, class Predicate>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/deque>
+#else
# include <__algorithm/copy.h>
# include <__algorithm/copy_backward.h>
# include <__algorithm/copy_n.h>
@@ -2648,6 +2649,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_DEQUE
diff --git a/libcxx/include/errno.h b/libcxx/include/errno.h
index 648d22e98846bb..692f00f022c53c 100644
--- a/libcxx/include/errno.h
+++ b/libcxx/include/errno.h
@@ -22,8 +22,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/errno.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -397,6 +398,6 @@ static const int __elast2 = 105;
# endif
# endif // __cplusplus
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ERRNO_H
diff --git a/libcxx/include/exception b/libcxx/include/exception
index f0eaba1295fa3d..266cce5a0d8d78 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -76,8 +76,9 @@ template <class E> void rethrow_if_nested(const E& e);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/exception>
+#else
# include <__config>
# include <__exception/exception.h>
# include <__exception/exception_ptr.h>
@@ -95,6 +96,6 @@ template <class E> void rethrow_if_nested(const E& e);
# include <cstdlib>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_EXCEPTION
diff --git a/libcxx/include/execution b/libcxx/include/execution
index e8ef8b1e6ee79b..7c695997cd0479 100644
--- a/libcxx/include/execution
+++ b/libcxx/include/execution
@@ -32,8 +32,9 @@ namespace std {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/execution>
+#else
# include <__config>
# include <__type_traits/is_execution_policy.h>
# include <__type_traits/is_same.h>
@@ -147,6 +148,6 @@ _LIBCPP_END_NAMESPACE_STD
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_EXECUTION
diff --git a/libcxx/include/expected b/libcxx/include/expected
index ac2415ff5a62d8..38038d328f17d0 100644
--- a/libcxx/include/expected
+++ b/libcxx/include/expected
@@ -38,8 +38,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/expected>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 23
@@ -54,6 +55,6 @@ namespace std {
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_EXPECTED
diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator
index 5075de537b6ac2..8448654e8d94ca 100644
--- a/libcxx/include/experimental/iterator
+++ b/libcxx/include/experimental/iterator
@@ -52,8 +52,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/iterator>
+#else
# include <__config>
# include <__memory/addressof.h>
# include <__ostream/basic_ostream.h>
@@ -128,6 +129,6 @@ _LIBCPP_POP_MACROS
# include <iosfwd>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_EXPERIMENTAL_ITERATOR
diff --git a/libcxx/include/experimental/memory b/libcxx/include/experimental/memory
index cb02ecb8e2bee7..1daa1cc4f3ed7c 100644
--- a/libcxx/include/experimental/memory
+++ b/libcxx/include/experimental/memory
@@ -49,8 +49,9 @@ public:
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/memory>
+#else
# include <__config>
# include <__cstddef/nullptr_t.h>
# include <__cstddef/size_t.h>
@@ -199,6 +200,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <cstddef>
# include <limits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif /* _LIBCPP_EXPERIMENTAL_MEMORY */
diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const
index 4d06e9f844acfa..8af3be366ad580 100644
--- a/libcxx/include/experimental/propagate_const
+++ b/libcxx/include/experimental/propagate_const
@@ -107,8 +107,9 @@
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/propagate_const>
+#else
# include <__config>
# include <__cstddef/nullptr_t.h>
# include <__cstddef/size_t.h>
@@ -491,6 +492,6 @@ _LIBCPP_POP_MACROS
# include <cstddef>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd
index 374ab57cdbca55..224cc75ba0eb0a 100644
--- a/libcxx/include/experimental/simd
+++ b/libcxx/include/experimental/simd
@@ -75,8 +75,9 @@ inline namespace parallelism_v2 {
# pragma GCC system_header
#endif
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/simd>
+#else
# include <__config>
# include <experimental/__simd/aligned_tag.h>
# include <experimental/__simd/declaration.h>
@@ -90,6 +91,6 @@ inline namespace parallelism_v2 {
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
diff --git a/libcxx/include/experimental/type_traits b/libcxx/include/experimental/type_traits
index 0da95b79f8ab77..0353526bc8f66b 100644
--- a/libcxx/include/experimental/type_traits
+++ b/libcxx/include/experimental/type_traits
@@ -68,8 +68,9 @@ inline namespace fundamentals_v1 {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/type_traits>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 14
@@ -155,6 +156,6 @@ _LIBCPP_END_NAMESPACE_LFTS
# endif
# endif /* _LIBCPP_STD_VER >= 14 */
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif /* _LIBCPP_EXPERIMENTAL_TYPE_TRAITS */
diff --git a/libcxx/include/experimental/utility b/libcxx/include/experimental/utility
index 1cb9c6a3617a8e..0c9b2b0c789ca4 100644
--- a/libcxx/include/experimental/utility
+++ b/libcxx/include/experimental/utility
@@ -30,8 +30,9 @@ inline namespace fundamentals_v1 {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/experimental/utility>
+#else
# include <__config>
# include <utility>
@@ -48,6 +49,6 @@ _LIBCPP_END_NAMESPACE_LFTS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */
diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index c9e35479b88c89..c0336620cf88f8 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -201,8 +201,9 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ext/hash_map>
+#else
# include <__config>
# include <__hash_table>
# include <algorithm>
@@ -870,6 +871,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multimap<_Key, _Tp, _Has
# include <iterator>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_HASH_MAP
diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 073fcf2fd9911b..2f86649d6e983f 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -192,8 +192,9 @@ template <class Value, class Hash, class Pred, class Alloc>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ext/hash_set>
+#else
# include <__config>
# include <__hash_table>
# include <algorithm>
@@ -582,6 +583,6 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const hash_multiset<_Value, _Hash,
# include <iterator>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_HASH_SET
diff --git a/libcxx/include/fenv.h b/libcxx/include/fenv.h
index dddf59d47f0214..157c24faa1042e 100644
--- a/libcxx/include/fenv.h
+++ b/libcxx/include/fenv.h
@@ -49,8 +49,9 @@ int feupdateenv(const fenv_t* envp);
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/fenv.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -112,6 +113,6 @@ extern "C++" {
} // extern "C++"
# endif // defined(__cplusplus)
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FENV_H
diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index f6f5dcb1cc4053..f9eb0ea1e24d2f 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -533,8 +533,9 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/filesystem>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 17
@@ -575,6 +576,6 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
# include <new>
# include <system_error>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FILESYSTEM
diff --git a/libcxx/include/flat_map b/libcxx/include/flat_map
index b99eebfa9fc538..217adc332e8e14 100644
--- a/libcxx/include/flat_map
+++ b/libcxx/include/flat_map
@@ -37,8 +37,9 @@ namespace std {
erase_if(flat_map<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/__config>
+#else
# include <__assert> // all public C++ headers provide the assertion handler
# include <__config>
# include <__flat_map/flat_map.h>
@@ -52,6 +53,6 @@ namespace std {
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FLAT_MAP
diff --git a/libcxx/include/float.h b/libcxx/include/float.h
index 2874323538b707..a6e79db912487a 100644
--- a/libcxx/include/float.h
+++ b/libcxx/include/float.h
@@ -70,8 +70,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/float.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -93,6 +94,6 @@
# endif
# endif // __cplusplus
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FLOAT_H
diff --git a/libcxx/include/format b/libcxx/include/format
index 6ac1e928b26a59..ecf8f7ce1eedba 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -191,8 +191,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/format>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -258,6 +259,6 @@ namespace std {
# include <cwchar>
# endif
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FORMAT
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index bc95b30f441fac..14df5f6acfadad 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -195,8 +195,9 @@ template <class T, class Allocator, class Predicate>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/forward_list>
+#else
# include <__algorithm/comp.h>
# include <__algorithm/lexicographical_compare.h>
# include <__algorithm/lexicographical_compare_three_way.h>
@@ -1586,6 +1587,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FORWARD_LIST
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 9722440808e365..f0e9425e0a53d9 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -186,8 +186,9 @@ typedef basic_fstream<wchar_t> wfstream;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/fstream>
+#else
# include <__algorithm/max.h>
# include <__assert>
# include <__config>
@@ -1585,6 +1586,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 23
# include <filesystem>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FSTREAM
diff --git a/libcxx/include/functional b/libcxx/include/functional
index 69f71314f05148..4bb163fd1f33cf 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -527,8 +527,9 @@ POLICY: For non-variadic implementations, the number of arguments is limited
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/functional>
+#else
# include <__config>
# include <__functional/binary_function.h>
@@ -596,6 +597,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited
# include <utility>
# include <vector>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FUNCTIONAL
diff --git a/libcxx/include/future b/libcxx/include/future
index 62f59682d404d3..15cc69aa24af4f 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -362,8 +362,9 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/future>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -2084,6 +2085,6 @@ _LIBCPP_POP_MACROS
# include <system_error>
# include <thread>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_FUTURE
diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list
index 46ffb95f83a697..07c51f32fee7d8 100644
--- a/libcxx/include/initializer_list
+++ b/libcxx/include/initializer_list
@@ -42,8 +42,9 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/initializer_list>
+#else
# include <__config>
# include <__cstddef/size_t.h>
# include <version>
@@ -101,6 +102,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_INITIALIZER_LIST
diff --git a/libcxx/include/inttypes.h b/libcxx/include/inttypes.h
index 552324516c11ff..1869284550e907 100644
--- a/libcxx/include/inttypes.h
+++ b/libcxx/include/inttypes.h
@@ -235,8 +235,9 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/inttypes.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -262,6 +263,6 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
# undef imaxdiv
# endif // __cplusplus
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_INTTYPES_H
diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip
index 84842dc3fa6ca2..a97b4a94d232ff 100644
--- a/libcxx/include/iomanip
+++ b/libcxx/include/iomanip
@@ -42,8 +42,9 @@ template <class charT, class traits, class Allocator>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/iomanip>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -563,6 +564,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <unordered_map>
# include <vector>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_IOMANIP
diff --git a/libcxx/include/ios b/libcxx/include/ios
index 23e8fdf1a6075e..7c2ee83d4624bf 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -211,8 +211,9 @@ storage-class-specifier const error_category& iostream_category() noexcept;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ios>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -891,6 +892,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_IOS
diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd
index 3f8a4cd3d4d8c3..708134daf98c9d 100644
--- a/libcxx/include/iosfwd
+++ b/libcxx/include/iosfwd
@@ -105,8 +105,9 @@ using wosyncstream = basic_osyncstream<wchar_t>; // C++20
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/iosfwd>
+#else
# include <__config>
# include <__fwd/fstream.h>
# include <__fwd/ios.h>
@@ -185,6 +186,6 @@ public:
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_IOSFWD
diff --git a/libcxx/include/iostream b/libcxx/include/iostream
index 067a7c111f4374..0e83f0002ae6e6 100644
--- a/libcxx/include/iostream
+++ b/libcxx/include/iostream
@@ -33,8 +33,9 @@ extern wostream wclog;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/iostream>
+#else
# include <__config>
# include <version>
@@ -66,6 +67,6 @@ extern _LIBCPP_EXPORTED_FROM_ABI wostream wclog;
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_IOSTREAM
diff --git a/libcxx/include/istream b/libcxx/include/istream
index c2edc9ab226082..4b177c41cc325e 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -158,8 +158,9 @@ template <class Stream, class T>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/istream>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -1383,6 +1384,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ISTREAM
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index b9bc1881106850..74ee712b945b33 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -679,8 +679,9 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/iterator>
+#else
# include <__config>
# include <__iterator/access.h>
# include <__iterator/advance.h>
@@ -753,6 +754,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_ITERATOR
diff --git a/libcxx/include/latch b/libcxx/include/latch
index d21b689cc48152..471ef143e8d5a1 100644
--- a/libcxx/include/latch
+++ b/libcxx/include/latch
@@ -40,8 +40,9 @@ namespace std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/latch>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -129,6 +130,6 @@ _LIBCPP_POP_MACROS
# include <atomic>
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_LATCH
diff --git a/libcxx/include/limits b/libcxx/include/limits
index c27950f42106d9..1c1a0b29b71877 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -102,8 +102,9 @@ template<> class numeric_limits<cv long double>;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/limits>
+#else
# include <__config>
# include <__type_traits/is_arithmetic.h>
# include <__type_traits/is_signed.h>
@@ -535,6 +536,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_LIMITS
diff --git a/libcxx/include/list b/libcxx/include/list
index 89863995379d9c..b8f8ac782be669 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -197,8 +197,9 @@ template <class T, class Allocator, class Predicate>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/list>
+#else
# include <__algorithm/comp.h>
# include <__algorithm/equal.h>
# include <__algorithm/lexicographical_compare.h>
@@ -1749,6 +1750,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_LIST
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 65b1200df061be..f5858cc89662a4 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -187,8 +187,9 @@ template <class charT> class messages_byname;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/locale>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -3700,6 +3701,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_LOCALE
diff --git a/libcxx/include/map b/libcxx/include/map
index 4e964d2265b471..5d1ea5d9cebd26 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -571,8 +571,9 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/map>
+#else
# include <__algorithm/equal.h>
# include <__algorithm/lexicographical_compare.h>
# include <__algorithm/lexicographical_compare_three_way.h>
@@ -2069,7 +2070,7 @@ template <class _Key,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
multimap(initializer_list<pair<_Key, _Tp>>,
- _Compare = _Compare(),
+ _Compare = _Compare(),
_Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
template <class _InputIterator,
@@ -2203,6 +2204,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_MAP
diff --git a/libcxx/include/math.h b/libcxx/include/math.h
index c338d3225dd55d..eab4f239eedb19 100644
--- a/libcxx/include/math.h
+++ b/libcxx/include/math.h
@@ -291,8 +291,9 @@ long double truncl(long double x);
*/
-# if 0
-# else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/math.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -504,7 +505,7 @@ using std::__math::trunc;
} // extern "C++"
# endif // __cplusplus
-# endif // 0
+# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#else // _LIBCPP_MATH_H
diff --git a/libcxx/include/mdspan b/libcxx/include/mdspan
index 02582c6f39c15d..a67ed1834e3bde 100644
--- a/libcxx/include/mdspan
+++ b/libcxx/include/mdspan
@@ -408,8 +408,9 @@ namespace std {
#ifndef _LIBCPP_MDSPAN
#define _LIBCPP_MDSPAN
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/mdspan>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 23
@@ -427,6 +428,6 @@ namespace std {
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_MDSPAN
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 883666b9e1beff..fc62606ea0fd33 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -934,8 +934,9 @@ template<class Pointer = void, class Smart, class... Args>
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/memory>
+#else
# include <__config>
# include <__memory/addressof.h>
# include <__memory/align.h>
@@ -996,6 +997,6 @@ template<class Pointer = void, class Smart, class... Args>
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_MEMORY
diff --git a/libcxx/include/memory_resource b/libcxx/include/memory_resource
index e852e96536c977..5464fc09c7cdcc 100644
--- a/libcxx/include/memory_resource
+++ b/libcxx/include/memory_resource
@@ -49,8 +49,9 @@ namespace std::pmr {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/memory_resource>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 17
@@ -75,6 +76,6 @@ namespace std::pmr {
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <stdexcept>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif /* _LIBCPP_MEMORY_RESOURCE */
diff --git a/libcxx/include/mutex b/libcxx/include/mutex
index b699439c5ce5a4..9b128e8710aaeb 100644
--- a/libcxx/include/mutex
+++ b/libcxx/include/mutex
@@ -186,8 +186,9 @@ template<class Callable, class ...Args>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/mutex>
+#else
# include <__chrono/steady_clock.h>
# include <__chrono/time_point.h>
# include <__condition_variable/condition_variable.h>
@@ -512,6 +513,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <typeinfo>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_MUTEX
diff --git a/libcxx/include/new b/libcxx/include/new
index 8bb7b300d08bce..3721d3e53a6e8c 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -86,8 +86,9 @@ void operator delete[](void* ptr, void*) noexcept;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/new>
+#else
# include <__config>
# include <__cstddef/max_align_t.h>
# include <__cstddef/size_t.h>
@@ -373,6 +374,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <cstdlib>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_NEW
diff --git a/libcxx/include/numbers b/libcxx/include/numbers
index 41ee888ba8a9c7..7c9e38ecb9da90 100644
--- a/libcxx/include/numbers
+++ b/libcxx/include/numbers
@@ -58,8 +58,9 @@ namespace std::numbers {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/numbers>
+#else
# include <__concepts/arithmetic.h>
# include <__config>
# include <version>
@@ -163,6 +164,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <cstddef>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_NUMBERS
diff --git a/libcxx/include/numeric b/libcxx/include/numeric
index 6055524b049973..2f2b86136fb983 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -156,8 +156,9 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/numeric>
+#else
# include <__config>
# include <__numeric/accumulate.h>
@@ -205,6 +206,6 @@ constexpr T saturate_cast(U x) noexcept; // freestanding, Sin
# include <optional>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_NUMERIC
diff --git a/libcxx/include/optional b/libcxx/include/optional
index b19c7a21aea372..7f0c4ace28ee54 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -177,8 +177,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/optional>
+#else
# include <__assert>
# include <__compare/compare_three_way_result.h>
# include <__compare/ordering.h>
@@ -1307,6 +1308,6 @@ _LIBCPP_POP_MACROS
# include <utility>
# include <variant>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_OPTIONAL
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index 900863c035be7d..4a627a07a4a2fe 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -172,8 +172,9 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ostream>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -204,6 +205,6 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
# include <stdexcept>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_OSTREAM
diff --git a/libcxx/include/print b/libcxx/include/print
index 3d846aeab3a886..1794d6014efcd9 100644
--- a/libcxx/include/print
+++ b/libcxx/include/print
@@ -33,8 +33,9 @@ namespace std {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/print>
+#else
# include <__assert>
# include <__concepts/same_as.h>
# include <__config>
@@ -401,6 +402,6 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(string_view __fmt, format_ar
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_PRINT
diff --git a/libcxx/include/queue b/libcxx/include/queue
index bebea92fc74252..ff69d75591debf 100644
--- a/libcxx/include/queue
+++ b/libcxx/include/queue
@@ -254,8 +254,9 @@ template <class T, class Container, class Compare>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/queue>
+#else
# include <__algorithm/make_heap.h>
# include <__algorithm/pop_heap.h>
# include <__algorithm/push_heap.h>
@@ -954,6 +955,6 @@ _LIBCPP_POP_MACROS
# include <functional>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_QUEUE
diff --git a/libcxx/include/random b/libcxx/include/random
index 08e9c384538f5f..a2fc2bd5197e57 100644
--- a/libcxx/include/random
+++ b/libcxx/include/random
@@ -1677,8 +1677,9 @@ class piecewise_linear_distribution
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/random>
+#else
# include <__config>
# include <__random/bernoulli_distribution.h>
# include <__random/binomial_distribution.h>
@@ -1740,6 +1741,6 @@ class piecewise_linear_distribution
# include <type_traits>
# include <vector>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_RANDOM
diff --git a/libcxx/include/ranges b/libcxx/include/ranges
index 2c6057e30420a1..9ef614d21f5251 100644
--- a/libcxx/include/ranges
+++ b/libcxx/include/ranges
@@ -380,8 +380,9 @@ namespace std {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ranges>
+#else
# include <__config>
# if _LIBCPP_STD_VER >= 20
@@ -453,6 +454,6 @@ namespace std {
# include <iosfwd>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_RANGES
diff --git a/libcxx/include/ratio b/libcxx/include/ratio
index 9e56eacae0f2d0..b35e2bd9dad654 100644
--- a/libcxx/include/ratio
+++ b/libcxx/include/ratio
@@ -81,8 +81,9 @@ using quetta = ratio <1'000'000'000'000'000'000'000'000'000'000, 1>; // Since C+
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/ratio>
+#else
# include <__config>
# include <__type_traits/integral_constant.h>
# include <climits>
@@ -493,6 +494,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_RATIO
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 1983ca9d9ff80c..15ec15a6985e2a 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -789,8 +789,9 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
} // std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/regex>
+#else
# include <__algorithm/find.h>
# include <__algorithm/search.h>
# include <__assert>
@@ -5834,6 +5835,6 @@ _LIBCPP_POP_MACROS
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_REGEX
diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator
index c207ac07bdc4d7..94a35f64603ba4 100644
--- a/libcxx/include/scoped_allocator
+++ b/libcxx/include/scoped_allocator
@@ -109,8 +109,9 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/scoped_allocator>
+#else
# include <__config>
# include <__memory/allocator_traits.h>
# include <__memory/uses_allocator_construction.h>
@@ -571,6 +572,6 @@ _LIBCPP_POP_MACROS
# include <type_traits>
# include <variant>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SCOPED_ALLOCATOR
diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore
index 82f9726a96f62c..4194dbe91b4810 100644
--- a/libcxx/include/semaphore
+++ b/libcxx/include/semaphore
@@ -45,8 +45,9 @@ using binary_semaphore = counting_semaphore<1>; // since C++20
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/semaphore>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -186,6 +187,6 @@ _LIBCPP_POP_MACROS
# include <atomic>
# include <cstddef>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SEMAPHORE
diff --git a/libcxx/include/set b/libcxx/include/set
index c4b0b018f27c41..7af7599a3d8d7e 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -512,8 +512,9 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/set>
+#else
# include <__algorithm/equal.h>
# include <__algorithm/lexicographical_compare.h>
# include <__algorithm/lexicographical_compare_three_way.h>
@@ -1394,7 +1395,7 @@ template <class _Key,
class = enable_if_t<__is_allocator<_Allocator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>>
multiset(initializer_list<_Key>,
- _Compare = _Compare(),
+ _Compare = _Compare(),
_Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>;
template <class _InputIterator,
@@ -1524,6 +1525,6 @@ _LIBCPP_POP_MACROS
# include <stdexcept>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SET
diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex
index a6615ea8962fd6..6738efeedb3c29 100644
--- a/libcxx/include/shared_mutex
+++ b/libcxx/include/shared_mutex
@@ -122,8 +122,9 @@ template <class Mutex>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/shared_mutex>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -462,6 +463,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <system_error>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SHARED_MUTEX
diff --git a/libcxx/include/source_location b/libcxx/include/source_location
index faa6b0eeb6c003..bbbb86bc68c835 100644
--- a/libcxx/include/source_location
+++ b/libcxx/include/source_location
@@ -25,8 +25,9 @@ namespace std {
}
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/source_location>
+#else
# include <__config>
# include <cstdint>
# include <version>
@@ -84,6 +85,6 @@ public:
_LIBCPP_END_NAMESPACE_STD
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SOURCE_LOCATION
diff --git a/libcxx/include/span b/libcxx/include/span
index 2d43d1d1079e44..5bb09ec515cea9 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -144,8 +144,9 @@ template<class R>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/span>
+#else
# include <__assert>
# include <__concepts/convertible_to.h>
# include <__concepts/equality_comparable.h>
@@ -640,6 +641,6 @@ _LIBCPP_POP_MACROS
# include <iterator>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SPAN
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index 920c29dee62f3f..5dcfb446a5d6ad 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -312,8 +312,9 @@ typedef basic_stringstream<wchar_t> wstringstream;
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/sstream>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -1291,6 +1292,6 @@ _LIBCPP_POP_MACROS
# include <ostream>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SSTREAM
diff --git a/libcxx/include/stack b/libcxx/include/stack
index da3dcf0216aeac..3ff3df2c9650fc 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -113,8 +113,9 @@ template <class T, class Container>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stack>
+#else
# include <__algorithm/ranges_copy.h>
# include <__config>
# include <__fwd/stack.h>
@@ -377,6 +378,6 @@ _LIBCPP_POP_MACROS
# include <functional>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STACK
diff --git a/libcxx/include/stdatomic.h b/libcxx/include/stdatomic.h
index 8c96bd636dd45f..a0b46e3b7bc173 100644
--- a/libcxx/include/stdatomic.h
+++ b/libcxx/include/stdatomic.h
@@ -117,8 +117,9 @@ using std::atomic_signal_fence // see below
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdatomic.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -237,6 +238,6 @@ using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
# endif
# endif // defined(__cplusplus)
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDATOMIC_H
diff --git a/libcxx/include/stdbool.h b/libcxx/include/stdbool.h
index 9f1779e992c72e..c34853b97b854c 100644
--- a/libcxx/include/stdbool.h
+++ b/libcxx/include/stdbool.h
@@ -19,8 +19,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdbool.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -38,6 +39,6 @@
# undef __bool_true_false_are_defined
# define __bool_true_false_are_defined 1
# endif
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDBOOL_H
diff --git a/libcxx/include/stddef.h b/libcxx/include/stddef.h
index 66ad85fe631de9..46bed2a1e1a68e 100644
--- a/libcxx/include/stddef.h
+++ b/libcxx/include/stddef.h
@@ -24,8 +24,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stddef.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -42,6 +43,6 @@
# ifdef __cplusplus
typedef decltype(nullptr) nullptr_t;
# endif
-# endif // 0
+# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDDEF_H
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index b3d805437a02ff..8cb403d5de2eb1 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -41,8 +41,9 @@ public:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdexcept>
+#else
# include <__config>
# include <__exception/exception.h>
# include <__fwd/string.h>
@@ -285,6 +286,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <exception>
# include <iosfwd>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDEXCEPT
diff --git a/libcxx/include/stdio.h b/libcxx/include/stdio.h
index dcf16dfb637827..55a36c8c85fa9d 100644
--- a/libcxx/include/stdio.h
+++ b/libcxx/include/stdio.h
@@ -98,8 +98,9 @@ int ferror(FILE* stream);
void perror(const char* s);
*/
-# if 0
-# else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdio.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -121,6 +122,6 @@ void perror(const char* s);
# undef getchar
# endif
-# endif // 0
+# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDIO_H
diff --git a/libcxx/include/stdlib.h b/libcxx/include/stdlib.h
index dca4c3a92de14a..774312e8eaf938 100644
--- a/libcxx/include/stdlib.h
+++ b/libcxx/include/stdlib.h
@@ -84,8 +84,9 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
*/
-# if 0
-# else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdlib.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -149,6 +150,6 @@ inline _LIBCPP_HIDE_FROM_ABI lldiv_t div(long long __x, long long __y) _NOEXCEPT
# endif // _LIBCPP_MSVCRT
} // extern "C++"
# endif // __cplusplus
-# endif // 0
+# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STDLIB_H
diff --git a/libcxx/include/stop_token b/libcxx/include/stop_token
index 6a6d1330248c7a..d240dd77a9136b 100644
--- a/libcxx/include/stop_token
+++ b/libcxx/include/stop_token
@@ -31,8 +31,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stop_token>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -55,6 +56,6 @@ namespace std {
# include <cstddef>
# include <iosfwd>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STOP_TOKEN
diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf
index 12f6b319f70e96..7f02a9b3314110 100644
--- a/libcxx/include/streambuf
+++ b/libcxx/include/streambuf
@@ -107,8 +107,9 @@ protected:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/streambuf>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -448,6 +449,6 @@ _LIBCPP_POP_MACROS
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstdint>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STREAMBUF
diff --git a/libcxx/include/string b/libcxx/include/string
index 17bf4b3b98bf34..187312922c25ba 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -586,8 +586,9 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/string>
+#else
# include <__algorithm/max.h>
# include <__algorithm/min.h>
# include <__algorithm/remove.h>
@@ -4371,6 +4372,6 @@ _LIBCPP_POP_MACROS
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STRING
diff --git a/libcxx/include/string.h b/libcxx/include/string.h
index 58a4bcbc3e7044..6bdcd6a6eecbdf 100644
--- a/libcxx/include/string.h
+++ b/libcxx/include/string.h
@@ -51,8 +51,9 @@ size_t strlen(const char* s);
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/string.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -109,6 +110,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD char* strstr(char* __s1,
}
} // extern "C++"
# endif
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STRING_H
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 27b9f152ea290a..7db4e4db72baf7 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -205,8 +205,9 @@ namespace std {
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/string_view>
+#else
# include <__algorithm/min.h>
# include <__assert>
# include <__config>
@@ -965,6 +966,6 @@ _LIBCPP_POP_MACROS
# include <iterator>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STRING_VIEW
diff --git a/libcxx/include/strstream b/libcxx/include/strstream
index 81dbdf14d9e6a4..90d56694e7a6c3 100644
--- a/libcxx/include/strstream
+++ b/libcxx/include/strstream
@@ -129,8 +129,9 @@ private:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/strstream>
+#else
# include <__config>
# include <__ostream/basic_ostream.h>
# include <istream>
@@ -350,6 +351,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_STRSTREAM
diff --git a/libcxx/include/syncstream b/libcxx/include/syncstream
index f801132d436b48..82761be765420c 100644
--- a/libcxx/include/syncstream
+++ b/libcxx/include/syncstream
@@ -117,8 +117,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/syncstream>
+#else
# include <__config>
# if _LIBCPP_HAS_LOCALIZATION
@@ -518,6 +519,6 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
# endif // _LIBCPP_HAS_LOCALIZATION
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SYNCSTREAM
diff --git a/libcxx/include/system_error b/libcxx/include/system_error
index 351e26fd473500..4dadc0a6ab4838 100644
--- a/libcxx/include/system_error
+++ b/libcxx/include/system_error
@@ -144,8 +144,9 @@ template <> struct hash<std::error_condition>;
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/system_error>
+#else
# include <__config>
# include <__system_error/errc.h>
# include <__system_error/error_category.h>
@@ -169,6 +170,6 @@ template <> struct hash<std::error_condition>;
# include <limits>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_SYSTEM_ERROR
diff --git a/libcxx/include/tgmath.h b/libcxx/include/tgmath.h
index 41cae5c2318c19..3f8f14fd579a93 100644
--- a/libcxx/include/tgmath.h
+++ b/libcxx/include/tgmath.h
@@ -17,8 +17,9 @@
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/tgmath.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -33,6 +34,6 @@
# include_next <tgmath.h>
# endif
# endif
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TGMATH_H
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 719ebe9a7a2376..029ed418e2070f 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -86,8 +86,9 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/thread>
+#else
# include <__config>
# if _LIBCPP_HAS_THREADS
@@ -127,6 +128,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
# include <system_error>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_THREAD
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 035c67a12f8567..016cdda6decb86 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -210,8 +210,9 @@ template <class... Types>
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/tuple>
+#else
# include <__compare/common_comparison_category.h>
# include <__compare/ordering.h>
# include <__compare/synth_three_way.h>
@@ -1421,6 +1422,6 @@ _LIBCPP_POP_MACROS
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TUPLE
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index d7fa8c3ad8f2ef..ffcddb0176615a 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -424,8 +424,9 @@ namespace std
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/type_traits>
+#else
# include <__config>
# include <__type_traits/add_cv_quals.h>
# include <__type_traits/add_lvalue_reference.h>
@@ -529,6 +530,6 @@ namespace std
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TYPE_TRAITS
diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex
index 5ecba006ff1c12..76faee4bf199e1 100644
--- a/libcxx/include/typeindex
+++ b/libcxx/include/typeindex
@@ -45,8 +45,9 @@ struct hash<type_index>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/typeindex>
+#else
# include <__config>
# include <__functional/unary_function.h>
# include <typeinfo>
@@ -105,6 +106,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <new>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TYPEINDEX
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index 8d3ebea08d8ddb..799c6ebd5ecbbf 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -56,8 +56,9 @@ public:
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/typeinfo>
+#else
# include <__config>
# include <__cstddef/size_t.h>
# include <__exception/exception.h>
@@ -390,6 +391,6 @@ _LIBCPP_END_NAMESPACE_STD
# include <cstdlib>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TYPEINFO
diff --git a/libcxx/include/uchar.h b/libcxx/include/uchar.h
index 440e00511a6607..01e1d57db7454c 100644
--- a/libcxx/include/uchar.h
+++ b/libcxx/include/uchar.h
@@ -32,8 +32,9 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/uchar.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -54,6 +55,6 @@ size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
# endif
# endif // _LIBCPP_CXX03_LANG
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_UCHAR_H
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 5d5979b28ff0e6..ab2916c2d3ae42 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -583,8 +583,9 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/unordered_map>
+#else
# include <__algorithm/is_permutation.h>
# include <__assert>
# include <__config>
@@ -2571,6 +2572,6 @@ _LIBCPP_POP_MACROS
# include <iterator>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_UNORDERED_MAP
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 6f243e0235ce9f..87f0a9f438eff2 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -531,8 +531,9 @@ template <class Value, class Hash, class Pred, class Alloc>
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/unordered_set>
+#else
# include <__algorithm/is_permutation.h>
# include <__assert>
# include <__config>
@@ -1843,6 +1844,6 @@ _LIBCPP_POP_MACROS
# include <stdexcept>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_UNORDERED_SET
diff --git a/libcxx/include/utility b/libcxx/include/utility
index c761a83000f34c..fb8a6f81350beb 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -246,8 +246,9 @@ template <class T>
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/utility>
+#else
# include <__config>
# include <__utility/declval.h>
@@ -308,6 +309,6 @@ template <class T>
# include <iosfwd>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_UTILITY
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index af916096b5ef9d..3cc72c2b6dbef5 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -343,8 +343,9 @@ template <class T> unspecified2 end(const valarray<T>& v);
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/valarray>
+#else
# include <__algorithm/copy.h>
# include <__algorithm/count.h>
# include <__algorithm/fill.h>
@@ -3362,6 +3363,6 @@ _LIBCPP_POP_MACROS
# include <stdexcept>
# include <type_traits>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_VALARRAY
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 9006e7ca35b093..0b0f30318281ca 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -212,8 +212,9 @@ namespace std {
*/
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/variant>
+#else
# include <__compare/common_comparison_category.h>
# include <__compare/compare_three_way_result.h>
# include <__compare/ordering.h>
@@ -1639,6 +1640,6 @@ _LIBCPP_POP_MACROS
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_VARIANT
diff --git a/libcxx/include/vector b/libcxx/include/vector
index a35686f56b0d5c..9fa81dcb7e76e0 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -304,8 +304,9 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
// clang-format on
-#if 0
-#else // 0
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/vector>
+#else
# include <__config>
# include <__vector/comparison.h>
@@ -368,6 +369,6 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
# include <typeinfo>
# include <utility>
# endif
-#endif // 0
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_VECTOR
diff --git a/libcxx/include/version b/libcxx/include/version
index fc57aeade9daf2..fa4b27eb7c67b3 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -269,11 +269,14 @@ __cpp_lib_void_t 201411L <type_traits>
*/
-#include <__config>
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/__config>
+#else
+# include <__config>
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
// clang-format off
@@ -583,4 +586,6 @@ __cpp_lib_void_t 201411L <type_traits>
// clang-format on
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+
#endif // _LIBCPP_VERSIONH
diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h
index c91d52c0ca6db1..1e36b04ad4d05f 100644
--- a/libcxx/include/wchar.h
+++ b/libcxx/include/wchar.h
@@ -105,8 +105,9 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
*/
-# if 0
-# else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/wchar.h>
+#else
# include <__config>
# include <stddef.h>
@@ -206,6 +207,6 @@ size_t wcsnrtombs(
} // extern "C"
# endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
-# endif // 0
+# endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_WCHAR_H
diff --git a/libcxx/include/wctype.h b/libcxx/include/wctype.h
index fb48d495e0392e..9a5b163ba43a98 100644
--- a/libcxx/include/wctype.h
+++ b/libcxx/include/wctype.h
@@ -44,8 +44,9 @@ wctrans_t wctrans(const char* property);
*/
-#if 0
-#else // 0
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/wctype.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -88,6 +89,6 @@ wctrans_t wctrans(const char* property);
# undef wctrans
# endif // __cplusplus
-#endif // 0
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_WCTYPE_H
diff --git a/libcxx/test/libcxx/algorithms/half_positive.pass.cpp b/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
index 40f46974195720..88a18e85929214 100644
--- a/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/half_positive.pass.cpp
@@ -11,6 +11,8 @@
// __half_positive divides an integer number by 2 as unsigned number for known types.
// It can be an important optimization for lower bound, for example.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__algorithm/half_positive.h>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp b/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
index 21e9003c30b704..390c6b6db190d7 100644
--- a/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
+++ b/libcxx/test/libcxx/assertions/customize_verbose_abort.link-time.pass.cpp
@@ -12,6 +12,8 @@
// failures when back-deploying.
// XFAIL: availability-verbose_abort-missing
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__verbose_abort>
#include <cstdlib>
diff --git a/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp b/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp
index 0cc4b1e0052267..803868b7577949 100644
--- a/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp
+++ b/libcxx/test/libcxx/assertions/default_verbose_abort.pass.cpp
@@ -9,6 +9,8 @@
// Test that the default verbose termination function aborts the program.
// XFAIL: availability-verbose_abort-missing
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__verbose_abort>
#include <csignal>
#include <cstdlib>
diff --git a/libcxx/test/libcxx/assertions/modes/none.pass.cpp b/libcxx/test/libcxx/assertions/modes/none.pass.cpp
index 8332848c1a8e03..b64290a31a1298 100644
--- a/libcxx/test/libcxx/assertions/modes/none.pass.cpp
+++ b/libcxx/test/libcxx/assertions/modes/none.pass.cpp
@@ -11,6 +11,8 @@
// REQUIRES: libcpp-hardening-mode=none
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__assert>
#include <cassert>
diff --git a/libcxx/test/libcxx/assertions/single_expression.pass.cpp b/libcxx/test/libcxx/assertions/single_expression.pass.cpp
index 13253e4cb6ef5a..474edc9dc08337 100644
--- a/libcxx/test/libcxx/assertions/single_expression.pass.cpp
+++ b/libcxx/test/libcxx/assertions/single_expression.pass.cpp
@@ -10,6 +10,8 @@
// This is useful so we can use them in places that require an expression, such as
// in a constructor initializer list.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__assert>
#include <cassert>
diff --git a/libcxx/test/libcxx/atomics/atomics.syn/compatible_with_stdatomic.compile.pass.cpp b/libcxx/test/libcxx/atomics/atomics.syn/compatible_with_stdatomic.compile.pass.cpp
index a52459abb9e0a5..323072da14463b 100644
--- a/libcxx/test/libcxx/atomics/atomics.syn/compatible_with_stdatomic.compile.pass.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.syn/compatible_with_stdatomic.compile.pass.cpp
@@ -8,6 +8,8 @@
// UNSUPPORTED: no-threads
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// This test verifies that <stdatomic.h> redirects to <atomic>. As an extension,
// libc++ enables this redirection even before C++23.
diff --git a/libcxx/test/libcxx/clang_modules_include.gen.py b/libcxx/test/libcxx/clang_modules_include.gen.py
index 4a14217738e78d..929695e3a99912 100644
--- a/libcxx/test/libcxx/clang_modules_include.gen.py
+++ b/libcxx/test/libcxx/clang_modules_include.gen.py
@@ -49,6 +49,8 @@
// TODO: Investigate why this doesn't work on Picolibc once the locale base API is refactored
// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME
+// UNSUPPORTED: FROZEN-CXX03-HEADERS-FIXME
+
{lit_header_restrictions.get(header, '')}
{lit_header_undeprecations.get(header, '')}
diff --git a/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
index c3d100e53711b3..a99f4fff1300e0 100644
--- a/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
@@ -13,6 +13,8 @@
// void
// __tree_balance_after_insert(_NodePtr __root, _NodePtr __x)
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__tree>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp
index 12289c84a9cc30..bebdcaaedf1037 100644
--- a/libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__tree>
#include <map>
#include <set>
diff --git a/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp
index b766489adc692f..f8073d6233c9b3 100644
--- a/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/tree_left_rotate.pass.cpp
@@ -13,6 +13,8 @@
// void
// __tree_left_rotate(_NodePtr __x);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__tree>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp
index e9afd845a7e31e..0b2d86722912eb 100644
--- a/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/tree_remove.pass.cpp
@@ -13,6 +13,8 @@
// void
// __tree_remove(_NodePtr __root, _NodePtr __z)
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__tree>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp b/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp
index 04d2b094aad695..16ca81fddc7dc3 100644
--- a/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/tree_right_rotate.pass.cpp
@@ -13,6 +13,8 @@
// void
// __tree_right_rotate(_NodePtr __x);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__tree>
#include <cassert>
diff --git a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
index cea074a4e70f1f..55d42a8d017e1c 100644
--- a/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/unord.map/abi.compile.pass.cpp
@@ -12,6 +12,8 @@
// unordered containers changes when bounded unique_ptr is enabled.
// UNSUPPORTED: libcpp-has-abi-bounded-unique_ptr
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cstdint>
#include <unordered_map>
diff --git a/libcxx/test/libcxx/containers/associative/unord.set/abi.compile.pass.cpp b/libcxx/test/libcxx/containers/associative/unord.set/abi.compile.pass.cpp
index 2a112aff227d8e..bee2012bbea292 100644
--- a/libcxx/test/libcxx/containers/associative/unord.set/abi.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/associative/unord.set/abi.compile.pass.cpp
@@ -12,6 +12,8 @@
// unordered containers changes when bounded unique_ptr is enabled.
// UNSUPPORTED: libcpp-has-abi-bounded-unique_ptr
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cstdint>
#include <unordered_set>
diff --git a/libcxx/test/libcxx/containers/container_traits.compile.pass.cpp b/libcxx/test/libcxx/containers/container_traits.compile.pass.cpp
index 1452bfbaf3960e..22be2174879510 100644
--- a/libcxx/test/libcxx/containers/container_traits.compile.pass.cpp
+++ b/libcxx/test/libcxx/containers/container_traits.compile.pass.cpp
@@ -9,6 +9,8 @@
// <__type_traits/container_traits.h>
//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__type_traits/container_traits.h>
#include <deque>
diff --git a/libcxx/test/libcxx/containers/unord/key_value_traits.pass.cpp b/libcxx/test/libcxx/containers/unord/key_value_traits.pass.cpp
index c5e420387fdaf4..4b389fa759f895 100644
--- a/libcxx/test/libcxx/containers/unord/key_value_traits.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/key_value_traits.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__hash_table>
#include <unordered_map>
#include <unordered_set>
diff --git a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
index 0b56c96f8d4e42..8a5d448dbf922b 100644
--- a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
@@ -18,6 +18,8 @@
// If n <= 1, return n. If n is a power of 2, return n.
// Otherwise, return the next power of 2.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__hash_table>
#include <cassert>
#include <cstdint>
diff --git a/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
index 0efbe0342d0b62..17a29033856c92 100644
--- a/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
@@ -16,6 +16,8 @@
// If n == 0, return 0, else return the lowest prime greater than or equal to n
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__hash_table>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
index d0ac71739d7e3a..f756aacbc1cd5b 100644
--- a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
+++ b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
@@ -10,6 +10,8 @@
// that we don't want to support and can't support with LSV enabled.
// UNSUPPORTED: clang-modules-build
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// 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/libcxx/test/libcxx/header_inclusions.gen.py b/libcxx/test/libcxx/header_inclusions.gen.py
index 739caf915c09a0..e00cf180d17ad1 100644
--- a/libcxx/test/libcxx/header_inclusions.gen.py
+++ b/libcxx/test/libcxx/header_inclusions.gen.py
@@ -10,6 +10,7 @@
# prescribed by the Standard.
# RUN: %{python} %s %{libcxx-dir}/utils
+# END.
import sys
@@ -45,6 +46,8 @@
print(
f"""\
//--- {header}.compile.pass.cpp
+// UNSUPPORTED: FROZEN-CXX03-HEADERS-FIXME
+
{lit_header_restrictions.get(header, '')}
{lit_header_undeprecations.get(header, '')}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
index 2157b2eb3cdf5d..37ab176ea26a0f 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
@@ -15,6 +15,8 @@
// UNSUPPORTED: no-wide-characters
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
std::basic_filebuf<char, std::char_traits<wchar_t> > f;
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
index b77f6a02013124..f936d8db47af5b 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
@@ -15,6 +15,8 @@
// UNSUPPORTED: no-wide-characters
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
std::basic_fstream<char, std::char_traits<wchar_t> > f;
diff --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
index 435e1df6dc4ba7..7d713ed581631e 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
@@ -15,6 +15,8 @@
// UNSUPPORTED: no-wide-characters
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <istream>
#include <string>
diff --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
index f947507b23a17a..445ddd1eb9e42e 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
@@ -15,6 +15,8 @@
// UNSUPPORTED: no-wide-characters
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <ostream>
#include <string>
diff --git a/libcxx/test/libcxx/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp b/libcxx/test/libcxx/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
index d6caa3389b8fa5..2b6c3802a56b66 100644
--- a/libcxx/test/libcxx/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
+++ b/libcxx/test/libcxx/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
@@ -8,6 +8,8 @@
// <sstream>
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// How the constructors of basic_stringbuf initialize the buffer pointers is
// not specified. For some constructors it's implementation defined whether the
// pointers are set to nullptr. Libc++'s implementation directly uses the SSO
diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
index 466ad70558fe59..89dc884c5da12f 100644
--- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
+++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
@@ -16,6 +16,8 @@
// UNSUPPORTED: no-wide-characters
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
diff --git a/libcxx/test/libcxx/iterators/aliasing_iterator.pass.cpp b/libcxx/test/libcxx/iterators/aliasing_iterator.pass.cpp
index 60587d5bfe5d7a..33774578e23371 100644
--- a/libcxx/test/libcxx/iterators/aliasing_iterator.pass.cpp
+++ b/libcxx/test/libcxx/iterators/aliasing_iterator.pass.cpp
@@ -8,6 +8,8 @@
// ADDITIONAL_COMPILE_FLAGS(clang): -Wprivate-header
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__iterator/aliasing_iterator.h>
#include <cassert>
diff --git a/libcxx/test/libcxx/iterators/bounded_iter/arithmetic.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/arithmetic.pass.cpp
index 45d0cc3b95f90b..3fc735b441676c 100644
--- a/libcxx/test/libcxx/iterators/bounded_iter/arithmetic.pass.cpp
+++ b/libcxx/test/libcxx/iterators/bounded_iter/arithmetic.pass.cpp
@@ -11,6 +11,8 @@
//
// Arithmetic operators
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__iterator/bounded_iter.h>
#include <cstddef>
diff --git a/libcxx/test/libcxx/iterators/bounded_iter/comparison.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/comparison.pass.cpp
index cef2157469c8f0..a12b77afa0db02 100644
--- a/libcxx/test/libcxx/iterators/bounded_iter/comparison.pass.cpp
+++ b/libcxx/test/libcxx/iterators/bounded_iter/comparison.pass.cpp
@@ -11,6 +11,8 @@
//
// Comparison operators
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <concepts>
#include <__iterator/bounded_iter.h>
diff --git a/libcxx/test/libcxx/iterators/bounded_iter/pointer_traits.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/pointer_traits.pass.cpp
index bfd779d644f51a..22ad8c6706d6fa 100644
--- a/libcxx/test/libcxx/iterators/bounded_iter/pointer_traits.pass.cpp
+++ b/libcxx/test/libcxx/iterators/bounded_iter/pointer_traits.pass.cpp
@@ -11,6 +11,8 @@
//
// std::pointer_traits specialization
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__iterator/bounded_iter.h>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/libcxx/iterators/bounded_iter/types.compile.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/types.compile.pass.cpp
index 56ded9ae5ed21d..d205c5b03ee3f0 100644
--- a/libcxx/test/libcxx/iterators/bounded_iter/types.compile.pass.cpp
+++ b/libcxx/test/libcxx/iterators/bounded_iter/types.compile.pass.cpp
@@ -11,6 +11,8 @@
//
// Nested types
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__iterator/bounded_iter.h>
#include <cstddef>
#include <iterator>
diff --git a/libcxx/test/libcxx/iterators/contiguous_iterators.conv.compile.pass.cpp b/libcxx/test/libcxx/iterators/contiguous_iterators.conv.compile.pass.cpp
index 372559594143ef..4d3690953070fd 100644
--- a/libcxx/test/libcxx/iterators/contiguous_iterators.conv.compile.pass.cpp
+++ b/libcxx/test/libcxx/iterators/contiguous_iterators.conv.compile.pass.cpp
@@ -15,6 +15,8 @@
// Verify that libc++-wrapped iterators do not permit slicing conversion or construction.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <array>
#include <span>
#include <type_traits>
diff --git a/libcxx/test/libcxx/iterators/contiguous_iterators.verify.cpp b/libcxx/test/libcxx/iterators/contiguous_iterators.verify.cpp
index 479d40a5eb0883..ba2697c78986c7 100644
--- a/libcxx/test/libcxx/iterators/contiguous_iterators.verify.cpp
+++ b/libcxx/test/libcxx/iterators/contiguous_iterators.verify.cpp
@@ -11,6 +11,8 @@
// __bounded_iter<_Iter>
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// Verify that __bounded_iter does not accept non-contiguous iterators as determined by __libcpp_is_contiguous_iterator.
// static_assert should be used, see https://github.com/llvm/llvm-project/issues/115002.
// __wrap_iter cannot be so handled because it may directly wrap user-defined fancy pointers in libc++'s vector.
diff --git a/libcxx/test/libcxx/iterators/iterator.primitives/iterator.operations/prev.verify.cpp b/libcxx/test/libcxx/iterators/iterator.primitives/iterator.operations/prev.verify.cpp
index da0a336815a5c8..ffef687723983f 100644
--- a/libcxx/test/libcxx/iterators/iterator.primitives/iterator.operations/prev.verify.cpp
+++ b/libcxx/test/libcxx/iterators/iterator.primitives/iterator.operations/prev.verify.cpp
@@ -8,6 +8,8 @@
// std::prev
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <iterator>
#include "test_iterators.h"
diff --git a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
index 37e3f8167051aa..b283c8aa06f0cb 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -21,6 +21,8 @@
// GCC doesn't support the aligned-allocation flags.
// XFAIL: gcc
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// RUN: %{build} -faligned-allocation -fsized-deallocation
// RUN: %{run}
// RUN: %{build} -faligned-allocation -fno-sized-deallocation -DNO_SIZE
diff --git a/libcxx/test/libcxx/memory/allocation_guard.pass.cpp b/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
index 493ebf044187c8..20c05b381ef0e7 100644
--- a/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
+++ b/libcxx/test/libcxx/memory/allocation_guard.pass.cpp
@@ -12,6 +12,8 @@
// To allow checking that self-move works correctly.
// ADDITIONAL_COMPILE_FLAGS: -Wno-self-move
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// template<class _Alloc>
// struct __allocation_guard;
diff --git a/libcxx/test/libcxx/memory/swap_allocator.pass.cpp b/libcxx/test/libcxx/memory/swap_allocator.pass.cpp
index 311660290eaef0..f70f8134d1ddaf 100644
--- a/libcxx/test/libcxx/memory/swap_allocator.pass.cpp
+++ b/libcxx/test/libcxx/memory/swap_allocator.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// <memory>
// template <typename _Alloc>
diff --git a/libcxx/test/libcxx/numerics/bit.ops.pass.cpp b/libcxx/test/libcxx/numerics/bit.ops.pass.cpp
index 7f502d6e01d1ea..1bf9d3890f45fb 100644
--- a/libcxx/test/libcxx/numerics/bit.ops.pass.cpp
+++ b/libcxx/test/libcxx/numerics/bit.ops.pass.cpp
@@ -9,6 +9,8 @@
// Test the __XXXX routines in the <bit> header.
// These are not supposed to be exhaustive tests, just sanity checks.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__bit/bit_log2.h>
#include <__bit/countl.h>
#include <__bit/rotate.h>
diff --git a/libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp b/libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp
index aed78f9cddf846..68d55afa1f2801 100644
--- a/libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp
+++ b/libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp
@@ -12,6 +12,8 @@
// closest representable value for the specified integer type, or
// numeric_limits<IntT>::max()/min() if the value isn't representable.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__random/clamp_to_integral.h>
#include <cassert>
#include <cmath>
diff --git a/libcxx/test/libcxx/numerics/complex.number/cmplx.over.pow.pass.cpp b/libcxx/test/libcxx/numerics/complex.number/cmplx.over.pow.pass.cpp
index 1c790c283e4387..8c1b3a17c669f4 100644
--- a/libcxx/test/libcxx/numerics/complex.number/cmplx.over.pow.pass.cpp
+++ b/libcxx/test/libcxx/numerics/complex.number/cmplx.over.pow.pass.cpp
@@ -8,6 +8,8 @@
// <complex>
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// template<class T, class U> complex<__promote<T, U>::type> pow(const complex<T>&, const U&);
// template<class T, class U> complex<__promote<T, U>::type> pow(const complex<T>&, const complex<U>&);
// template<class T, class U> complex<__promote<T, U>::type> pow(const T&, const complex<U>&);
diff --git a/libcxx/test/libcxx/selftest/test_macros.pass.cpp b/libcxx/test/libcxx/selftest/test_macros.pass.cpp
index caa31ba333d3c1..9bcf7cf9a31f52 100644
--- a/libcxx/test/libcxx/selftest/test_macros.pass.cpp
+++ b/libcxx/test/libcxx/selftest/test_macros.pass.cpp
@@ -7,6 +7,9 @@
//===----------------------------------------------------------------------===//
//
// Test the "test_macros.h" header.
+
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__config>
#include "test_macros.h"
diff --git a/libcxx/test/libcxx/strings/c.strings/constexpr_memmove.pass.cpp b/libcxx/test/libcxx/strings/c.strings/constexpr_memmove.pass.cpp
index bdc18448d03a43..2009cbe28a91f2 100644
--- a/libcxx/test/libcxx/strings/c.strings/constexpr_memmove.pass.cpp
+++ b/libcxx/test/libcxx/strings/c.strings/constexpr_memmove.pass.cpp
@@ -19,6 +19,8 @@
// and is_trivially_XXX_assignable), so we use some funky types to test these
// corner cases.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__string/constexpr_c_functions.h>
#include <cassert>
#include <cstdint>
diff --git a/libcxx/test/libcxx/transitive_includes.gen.py b/libcxx/test/libcxx/transitive_includes.gen.py
index f01dbac26a8e8a..6f992404366327 100644
--- a/libcxx/test/libcxx/transitive_includes.gen.py
+++ b/libcxx/test/libcxx/transitive_includes.gen.py
@@ -90,6 +90,8 @@
// TODO: Figure out why <stdatomic.h> doesn't work on FreeBSD
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
+// UNSUPPORTED: FROZEN-CXX03-HEADERS-FIXME
+
// RUN: mkdir %t
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes/to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
diff --git a/libcxx/test/libcxx/type_traits/datasizeof.compile.pass.cpp b/libcxx/test/libcxx/type_traits/datasizeof.compile.pass.cpp
index 51e3a8534baea5..67a4dccb0f5fef 100644
--- a/libcxx/test/libcxx/type_traits/datasizeof.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/datasizeof.compile.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__type_traits/datasizeof.h>
#include <cstdint>
#include <type_traits>
diff --git a/libcxx/test/libcxx/type_traits/is_constant_evaluated.pass.cpp b/libcxx/test/libcxx/type_traits/is_constant_evaluated.pass.cpp
index 5a779c0e96e210..a538c52a534e7f 100644
--- a/libcxx/test/libcxx/type_traits/is_constant_evaluated.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_constant_evaluated.pass.cpp
@@ -14,6 +14,8 @@
// returns false when there's no constant evaluation support from the compiler.
// as well as when called not in a constexpr context
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__type_traits/is_constant_evaluated.h>
#include <cassert>
diff --git a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
index e2be399456b1bc..e9b53080fcd6d6 100644
--- a/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_trivially_comparable.compile.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__type_traits/conditional.h>
#include <__type_traits/is_equality_comparable.h>
#include <__type_traits/is_signed.h>
diff --git a/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
index 110180ffa055a9..674df1d0219057 100644
--- a/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__type_traits/is_trivially_relocatable.h>
#include <array>
#include <deque>
diff --git a/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp b/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp
index f6b8a29d368211..fb51a4bf4ed273 100644
--- a/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp
+++ b/libcxx/test/libcxx/utilities/exception_guard.odr.sh.cpp
@@ -9,6 +9,8 @@
// This test relies on `typeid` and thus requires `-frtti`.
// UNSUPPORTED: no-rtti
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// Make sure that we don't get ODR violations with __exception_guard when
// linking together TUs compiled with different values of -f[no-]exceptions.
diff --git a/libcxx/test/libcxx/utilities/is_pointer_in_range.pass.cpp b/libcxx/test/libcxx/utilities/is_pointer_in_range.pass.cpp
index fc4d3a9800d119..b0a27c79287d40 100644
--- a/libcxx/test/libcxx/utilities/is_pointer_in_range.pass.cpp
+++ b/libcxx/test/libcxx/utilities/is_pointer_in_range.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__utility/is_pointer_in_range.h>
#include <cassert>
diff --git a/libcxx/test/libcxx/utilities/is_valid_range.pass.cpp b/libcxx/test/libcxx/utilities/is_valid_range.pass.cpp
index 345e2feeda81c7..cb800aee5674bb 100644
--- a/libcxx/test/libcxx/utilities/is_valid_range.pass.cpp
+++ b/libcxx/test/libcxx/utilities/is_valid_range.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__utility/is_valid_range.h>
#include <cassert>
diff --git a/libcxx/test/libcxx/utilities/meta/meta_base.pass.cpp b/libcxx/test/libcxx/utilities/meta/meta_base.pass.cpp
index 89f08088921d59..66c25b1d756385 100644
--- a/libcxx/test/libcxx/utilities/meta/meta_base.pass.cpp
+++ b/libcxx/test/libcxx/utilities/meta/meta_base.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include "test_macros.h"
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wprivate-header")
diff --git a/libcxx/test/libcxx/utilities/no_destroy.pass.cpp b/libcxx/test/libcxx/utilities/no_destroy.pass.cpp
index 9a874a64075372..8693bb17089dc3 100644
--- a/libcxx/test/libcxx/utilities/no_destroy.pass.cpp
+++ b/libcxx/test/libcxx/utilities/no_destroy.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <__utility/no_destroy.h>
#include <cassert>
diff --git a/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp b/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp
index 214b0eff8d9d26..ae8464ac946a96 100644
--- a/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp
+++ b/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp
@@ -8,6 +8,8 @@
// test that <bitset> includes <string>, <stdexcept> and <iosfwd>
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <bitset>
#include "test_macros.h"
diff --git a/libcxx/test/libcxx/utilities/utility/private_constructor_tag.compile.pass.cpp b/libcxx/test/libcxx/utilities/utility/private_constructor_tag.compile.pass.cpp
index 097e05f29cebd1..bae08241090712 100644
--- a/libcxx/test/libcxx/utilities/utility/private_constructor_tag.compile.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/private_constructor_tag.compile.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// struct __private_constructor_tag{};
// The private constructor tag is intended to be a trivial type that can easily
diff --git a/libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp b/libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp
index da16fd4626632d..d82d0d6249b00b 100644
--- a/libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp
@@ -10,6 +10,8 @@
// void fill(const T& u);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <array>
#include <cassert>
diff --git a/libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp b/libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp
index 03cfccac80b738..7816b26578246f 100644
--- a/libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp
@@ -10,6 +10,8 @@
// void swap(array& a);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <array>
#include <cassert>
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
index d776d72b054670..f3a425e6537cb4 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
@@ -10,6 +10,8 @@
// template <size_t I, class T, size_t N> T& get(array<T, N>& a);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-array-bounds
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
index 168467a6ed3611..b5c852225e7df6 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
@@ -10,6 +10,8 @@
// tuple_element<I, array<T, N> >::type
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <array>
#include <cassert>
diff --git a/libcxx/test/std/containers/sequences/array/size_and_alignment.compile.pass.cpp b/libcxx/test/std/containers/sequences/array/size_and_alignment.compile.pass.cpp
index 7ba56577d1bb76..53356b4c7eee40 100644
--- a/libcxx/test/std/containers/sequences/array/size_and_alignment.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/size_and_alignment.compile.pass.cpp
@@ -14,6 +14,8 @@
// Make sure std::array<T, N> has the correct object size and alignment.
// This test is mostly meant to catch subtle ABI-breaking regressions.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// Ignore error about requesting a large alignment not being ABI compatible with older AIX systems.
#if defined(_AIX)
# pragma clang diagnostic ignored "-Waix-compat"
diff --git a/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
index 54766013d907d3..116891d4980be9 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp
@@ -24,6 +24,8 @@
// ...
// };
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <forward_list>
#include <type_traits>
diff --git a/libcxx/test/std/containers/sequences/list/types.pass.cpp b/libcxx/test/std/containers/sequences/list/types.pass.cpp
index 0c0a127bd76f9c..a2d49080f1bcbb 100644
--- a/libcxx/test/std/containers/sequences/list/types.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/types.pass.cpp
@@ -21,6 +21,8 @@
// typedef typename allocator_type::pointer pointer;
// typedef typename allocator_type::const_pointer const_pointer;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <list>
#include <type_traits>
diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
index 679eec24137935..00de05347bfd92 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
@@ -11,6 +11,8 @@
// (bug report: https://llvm.org/PR58392)
// Check that vector constructors don't leak memory when an operation inside the constructor throws an exception
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cstddef>
#include <memory>
#include <type_traits>
diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
index f0157eb74b90f3..4ec94f696c090b 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
@@ -10,6 +10,8 @@
// iterator erase(const_iterator position);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <vector>
#include <cassert>
#include <memory>
diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
index 104dfb4cb07d4f..ea263509a64c50 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
@@ -10,6 +10,8 @@
// iterator erase(const_iterator first, const_iterator last);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <vector>
#include <cassert>
#include <memory>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
index d15276b440157c..d2efaf1561631f 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
@@ -13,6 +13,8 @@
// basic_fstream();
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include "test_macros.h"
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
index 95a04bdfccdbcb..153487898e1578 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
@@ -13,6 +13,8 @@
// basic_fstream(basic_fstream&& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
index 2e0ebcd684d798..ca226242773ad3 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
@@ -18,6 +18,8 @@
// XFAIL: LIBCXX-AIX-FIXME
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
index ca0921a00b9b60..28cefc77d6a902 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
@@ -13,6 +13,8 @@
// explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
index 70d1efca20c655..256380d2c164a0 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
@@ -13,6 +13,8 @@
// basic_ifstream();
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include "test_macros.h"
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
index 81ec800954cc27..c8be388f406986 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
@@ -8,6 +8,8 @@
// FILE_DEPENDENCIES: test.dat
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// <fstream>
// template <class charT, class traits = char_traits<charT> >
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
index 6bbe6f1ff77545..711ab2a74b516b 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
@@ -8,6 +8,8 @@
// FILE_DEPENDENCIES: test.dat
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// <fstream>
// template <class charT, class traits = char_traits<charT> >
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
index e1a9b53da1348d..d4bbb3c0cabfce 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
@@ -15,6 +15,8 @@
// explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
index a7b0918f793653..4cda1db438342e 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
@@ -13,6 +13,8 @@
// basic_ofstream();
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include "test_macros.h"
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
index ec02fa2621c199..501a4c90ca3feb 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
@@ -13,6 +13,8 @@
// basic_ofstream(basic_ofstream&& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
index fbb03f1e858411..1b5a55df737177 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
@@ -18,6 +18,8 @@
// XFAIL: LIBCXX-AIX-FIXME
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
#include <ios>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
index 33a7e9b2b6f50c..bb18c88bd326e6 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
@@ -13,6 +13,8 @@
// explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <fstream>
#include <cassert>
#include <ios>
diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
index 8c73df42ae4bec..8cd23d45598b8f 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
@@ -15,6 +15,8 @@
// basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20
// explicit basic_istringstream(ios_base::openmode which); // C++20
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
index 00ac7cc6414e9b..1af3304d089717 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
@@ -13,6 +13,8 @@
// basic_istringstream(basic_istringstream&& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
index 4a5965e7e96e90..7755dd926c2f68 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
@@ -14,6 +14,8 @@
// explicit basic_istringstream(const basic_string<charT,traits,allocator>& str,
// ios_base::openmode which = ios_base::in);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
index a6b98a4e362931..eb248a7801a3c1 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
@@ -15,6 +15,8 @@
// basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20
// explicit basic_ostringstream(ios_base::openmode which); // C++20
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
index 596a3e7d535844..62ece7b63b31ce 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
@@ -13,6 +13,8 @@
// basic_ostringstream(basic_ostringstream&& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
index 9e9405ad492175..bbec8f79a1862a 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
@@ -14,6 +14,8 @@
// explicit basic_ostringstream(const basic_string<charT,traits,allocator>& str,
// ios_base::openmode which = ios_base::in);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
index d131f5c9a6fa73..dac43967d815f6 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
@@ -15,6 +15,8 @@
// basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
// explicit basic_stringbuf(ios_base::openmode which); // C++20
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/default.pass.cpp
index 4f9e7e026c50f2..0e535814ae54ee 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/default.pass.cpp
@@ -15,6 +15,8 @@
// basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20
// explicit basic_stringstream(ios_base::openmode which); // C++20
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/move.pass.cpp
index 0702d9a278d3cb..e905f5f7c686a5 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/move.pass.cpp
@@ -13,6 +13,8 @@
// basic_stringstream(basic_stringstream&& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/string.pass.cpp
index 08880878361da4..d4fe18afbd28fa 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream/stringstream.cons/string.pass.cpp
@@ -14,6 +14,8 @@
// explicit basic_stringstream(const basic_string<charT,traits,Allocator>& str,
// ios_base::openmode which = ios_base::out|ios_base::in);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <sstream>
#include <cassert>
diff --git a/libcxx/test/std/language.support/support.runtime/cstdalign.compile.pass.cpp b/libcxx/test/std/language.support/support.runtime/cstdalign.compile.pass.cpp
index fbbaf9b2d136f9..69296dfa501216 100644
--- a/libcxx/test/std/language.support/support.runtime/cstdalign.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/cstdalign.compile.pass.cpp
@@ -10,6 +10,8 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cstdalign>
#ifndef __alignas_is_defined
diff --git a/libcxx/test/std/numerics/c.math/isnormal.pass.cpp b/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
index 76c3d13520d996..03b086fa3f48e7 100644
--- a/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/isnormal.pass.cpp
@@ -11,6 +11,8 @@
// We don't control the implementation on windows
// UNSUPPORTED: windows
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <cmath>
#include <limits>
diff --git a/libcxx/test/std/numerics/c.math/signbit.pass.cpp b/libcxx/test/std/numerics/c.math/signbit.pass.cpp
index a8a566f7de6434..cbad968a8aa203 100644
--- a/libcxx/test/std/numerics/c.math/signbit.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/signbit.pass.cpp
@@ -14,6 +14,8 @@
// These compilers don't support constexpr `__builtin_signbit` yet.
// UNSUPPORTED: clang-17, clang-18, clang-19, apple-clang-15, apple-clang-16
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <cmath>
#include <limits>
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index 988beec15e6446..789d248d9ff28b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -16,6 +16,8 @@
// regex_constants::match_flag_type flags
// = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index 9765a07f2e4fe3..88c37cee687ca6 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index 4face8ba02bbe3..ac04867d2bd4e4 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/egrep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/egrep.pass.cpp
index 4e1b6940c09e17..83af0fae46d690 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/egrep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/egrep.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index 73c1d8352ab2bf..1d9f80fc3eae48 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/grep.pass.cpp
index 0f75d618c0c022..2580e0a7d8d364 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/grep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/grep.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/lookahead_capture.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/lookahead_capture.pass.cpp
index 1550f3728563a8..cce78eee2c3c6e 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/lookahead_capture.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/lookahead_capture.pass.cpp
@@ -18,6 +18,8 @@
// std::regex in ECMAScript mode should not ignore capture groups inside lookahead assertions.
// For example, matching /(?=(a))(a)/ to "a" should yield two captures: \1 = "a", \2 = "a"
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/parse_curly_brackets.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/parse_curly_brackets.pass.cpp
index a680baf9dde8b9..5e3ef27a396c86 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/parse_curly_brackets.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/parse_curly_brackets.pass.cpp
@@ -17,6 +17,8 @@
// https://llvm.org/PR16135
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <string>
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/exponential.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/exponential.pass.cpp
index 316759fd895dd9..ced58765bbfd75 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/exponential.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/exponential.pass.cpp
@@ -19,6 +19,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test1.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test1.pass.cpp
index 193dd614d6e795..6d9c34d8f9c4e1 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test1.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test1.pass.cpp
@@ -18,6 +18,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test2.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test2.pass.cpp
index ed5230a9e78dcb..23c7046fb19e12 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test2.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test2.pass.cpp
@@ -18,6 +18,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test3.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test3.pass.cpp
index 09ecc53a9f998d..d8e23bab50757b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test3.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test3.pass.cpp
@@ -16,6 +16,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test4.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test4.pass.cpp
index 4d567ed1f644f5..8cf417c73439f5 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test4.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test4.pass.cpp
@@ -15,6 +15,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test5.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test5.pass.cpp
index 585a60f8780e19..20ba92531c319d 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test5.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test5.pass.cpp
@@ -16,6 +16,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/test6.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/test6.pass.cpp
index 66a910172c4972..cf6c960236eea9 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/test6.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/test6.pass.cpp
@@ -16,6 +16,8 @@
// regex_constants::match_flag_type flags =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.replace/zero_length_matches.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.replace/zero_length_matches.pass.cpp
index 2f1b6280deb780..1939629f3bf8db 100644
--- a/libcxx/test/std/re/re.alg/re.alg.replace/zero_length_matches.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.replace/zero_length_matches.pass.cpp
@@ -10,6 +10,8 @@
// Test that replacing zero-length matches works correctly.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <regex>
#include <string>
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index 2c23cf0f700792..09ed0b319eb9bd 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/backup.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/backup.pass.cpp
index 22d522163ce130..7a6d24e728194e 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/backup.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/backup.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <string>
#include <list>
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index 99f94f26b32aec..ab91537f525952 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index 518c27e4244846..ea57fa01c6ab53 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/egrep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/egrep.pass.cpp
index df8560f5fa8c4f..54fd3086ef5d16 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/egrep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/egrep.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index 0ddb49d619a181..0912a457814319 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -16,6 +16,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 3569ad53ee60b3..4aa56b03c75e75 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp
index 9334bcc5b2b09b..71553f69a14dc1 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/invert_neg_word_search.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/lookahead.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/lookahead.pass.cpp
index 1a3ebfc6442c2d..8506ed46475ddf 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/lookahead.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/lookahead.pass.cpp
@@ -17,6 +17,8 @@
// https://llvm.org/PR11118
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/no_update_pos.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/no_update_pos.pass.cpp
index 73158dc53c9128..93434084c6ff65 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/no_update_pos.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/no_update_pos.pass.cpp
@@ -15,6 +15,8 @@
// const basic_regex<charT, traits>& e,
// regex_constants::match_flag_type flags = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.const/re.matchflag/match_not_bol.pass.cpp b/libcxx/test/std/re/re.const/re.matchflag/match_not_bol.pass.cpp
index 6522d429ebccc6..0469bc68b072c4 100644
--- a/libcxx/test/std/re/re.const/re.matchflag/match_not_bol.pass.cpp
+++ b/libcxx/test/std/re/re.const/re.matchflag/match_not_bol.pass.cpp
@@ -13,6 +13,8 @@
// though it is not at the beginning of a line, so the character ^ in the
// regular expression shall not match [first,first).
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.const/re.matchflag/match_not_eol.pass.cpp b/libcxx/test/std/re/re.const/re.matchflag/match_not_eol.pass.cpp
index 89d939eaf809f4..54e15d9c69df14 100644
--- a/libcxx/test/std/re/re.const/re.matchflag/match_not_eol.pass.cpp
+++ b/libcxx/test/std/re/re.const/re.matchflag/match_not_eol.pass.cpp
@@ -13,6 +13,8 @@
// though it is not at the end of a line, so the character "$" in
// the regular expression shall not match [last,last).
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp b/libcxx/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp
index 645f79a0d85c99..a81977f1b6f72c 100644
--- a/libcxx/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp
+++ b/libcxx/test/std/re/re.const/re.matchflag/match_not_null.pass.cpp
@@ -11,6 +11,8 @@
// match_not_null:
// The regular expression shall not match an empty sequence.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include "test_macros.h"
#include <cassert>
#include <regex>
diff --git a/libcxx/test/std/re/re.const/re.matchflag/match_prev_avail.pass.cpp b/libcxx/test/std/re/re.const/re.matchflag/match_prev_avail.pass.cpp
index 508b8dd43be953..0b9599f47681e4 100644
--- a/libcxx/test/std/re/re.const/re.matchflag/match_prev_avail.pass.cpp
+++ b/libcxx/test/std/re/re.const/re.matchflag/match_prev_avail.pass.cpp
@@ -13,6 +13,8 @@
// match_not_bol and match_not_bow shall be ignored by the regular
// expression algorithms (30.11) and iterators (30.12)
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/cnstr.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/cnstr.pass.cpp
index a6d10597451054..daf4749551e76c 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/cnstr.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/cnstr.pass.cpp
@@ -14,6 +14,8 @@
// const regex_type& re,
// regex_constants::match_flag_type m = regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.deref/deref.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.deref/deref.pass.cpp
index 11b12b2eef8c4c..11f70b77ef6ea7 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.deref/deref.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.deref/deref.pass.cpp
@@ -12,6 +12,8 @@
// const value_type& operator*() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
index aefe86f1529809..8bd7369afb7fd7 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.incr/post.pass.cpp
@@ -12,6 +12,8 @@
// regex_iterator operator++(int);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
index ed1d5ee9633894..5fe926d7304451 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/array.pass.cpp
@@ -17,6 +17,8 @@
// regex_constants::match_flag_type m =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
index a5087817223c52..2f9f6360a8b8eb 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
@@ -18,6 +18,8 @@
// regex_constants::match_flag_type m =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
index 2abed8e827cd9d..2e5a81e9ac0bf5 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/int.pass.cpp
@@ -15,6 +15,8 @@
// regex_constants::match_flag_type m =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
index b2ef0b23e528e7..4afec14cc2a131 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/vector.pass.cpp
@@ -16,6 +16,8 @@
// regex_constants::match_flag_type m =
// regex_constants::match_default);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.comp/equal.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.comp/equal.pass.cpp
index ef0fd5cd111ad5..fce1e24ebbd946 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.comp/equal.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.comp/equal.pass.cpp
@@ -14,6 +14,8 @@
// bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); } // since C++20
// bool operator!=(const regex_token_iterator& right) const; // generated by the compiler in C++20
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <iterator>
#include <regex>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
index 1785df2abe1810..05432c45c15498 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.deref/deref.pass.cpp
@@ -12,6 +12,8 @@
// const value_type& operator*() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
index 8d44f3a5ae66ca..b6ba0ed9d10168 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/re.tokiter.incr/post.pass.cpp
@@ -12,6 +12,8 @@
// regex_token_iterator& operator++(int);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <iterator>
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/assign.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
index c580ab96cbab09..2e2c9bfd327067 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex& assign(const basic_regex& that);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp
index 21717cfd1f7ba9..68ab7b604f1236 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp
@@ -15,6 +15,8 @@
// assign(InputIterator first, InputIterator last,
// flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <regex>
#include <string>
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp
index 9445bbaf9ff6f9..9832a62f6ed99d 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
index e74a42b6934090..bde6abcd0f32e4 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex& assign(const charT* ptr, size_t len, flag_type f);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp
index 4f09e3d6e42695..68f9aaf7e2cc05 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp
@@ -14,6 +14,8 @@
// basic_regex& assign(const basic_string<charT, string_traits, A>& s,
// flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cassert>
#include <regex>
#include <string>
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/copy.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/copy.pass.cpp
index 1abb7215165164..0fe8d1bd00fd93 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/copy.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/copy.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex& operator=(const basic_regex& e);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/ptr.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/ptr.pass.cpp
index 3791f81527283a..db9774559f1464 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/ptr.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/ptr.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex& operator=(const charT* ptr);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.assign/string.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.assign/string.pass.cpp
index e33819ab3c37ee..b9992cc1c185fc 100644
--- a/libcxx/test/std/re/re.regex/re.regex.assign/string.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.assign/string.pass.cpp
@@ -13,6 +13,8 @@
// template <class ST, class SA>
// basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
index 2e7eed350c0302..245dee05f0c829 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
@@ -13,6 +13,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp
index 09b9e89521e1b5..617d1ae0c90168 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp
@@ -14,6 +14,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp
index 31f6e9a711ba72..be13295abc4a82 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp
@@ -14,6 +14,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
index abb854e44f6920..9d67653c3c9e8f 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
@@ -14,6 +14,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_range.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_range.pass.cpp
index 023bc0ee79f443..d5d1744c90c066 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_range.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_range.pass.cpp
@@ -14,6 +14,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
index b600ef70e176a0..6d93cdd7ff9957 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
@@ -14,6 +14,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/copy.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/copy.pass.cpp
index f3db8fe06113bf..0c6263c0bc61f7 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/copy.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/copy.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex(const basic_regex& e);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter.pass.cpp
index 3dcf29fa00965f..705c7bb0f18681 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter.pass.cpp
@@ -13,6 +13,8 @@
// template <class ForwardIterator>
// basic_regex(ForwardIterator first, ForwardIterator last);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp
index 22423c09282075..dd148b985863e0 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp
@@ -14,6 +14,8 @@
// basic_regex(ForwardIterator first, ForwardIterator last,
// flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp
index b71d9eb7f497ce..a36347df3c3933 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/ptr.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex(const charT* p);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_flg.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_flg.pass.cpp
index e918b03116ba91..d50587dd5219f2 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_flg.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_flg.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp
index 1d99069f1b0def..5a43d145bb53cf 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex(const charT* p, size_t len);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp
index 07f3947318ed34..a1e20aeb82afaf 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp
@@ -12,6 +12,8 @@
// basic_regex(const charT* p, size_t len, flag_type f);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/string.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/string.pass.cpp
index ecd0451d82b821..1697e3bfb49464 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/string.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/string.pass.cpp
@@ -13,6 +13,8 @@
// template <class ST, class SA>
// basic_regex(const basic_string<charT, ST, SA>& s);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/string_flg.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/string_flg.pass.cpp
index b6bd8c53c5ae22..b4da9ea2cedf19 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/string_flg.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/string_flg.pass.cpp
@@ -14,6 +14,8 @@
// basic_regex(const basic_string<charT, ST, SA>& s,
// flag_type f = regex_constants::ECMAScript);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp
index bb3291be6f05f8..15c7b900cd2b5e 100644
--- a/libcxx/test/std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp
@@ -13,6 +13,8 @@
// template <class charT, class traits>
// void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.regex/re.regex.swap/swap.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.swap/swap.pass.cpp
index 5092d57c148116..3e0e67d0f3d764 100644
--- a/libcxx/test/std/re/re.regex/re.regex.swap/swap.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.swap/swap.pass.cpp
@@ -12,6 +12,8 @@
// void swap(basic_regex& e);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/begin_end.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
index 48fff58b019ee5..18d3449383f9f0 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/begin_end.pass.cpp
@@ -13,6 +13,8 @@
// const_iterator begin() const;
// const_iterator end() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
index bd9009a8a447cd..326afae3623eda 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/cbegin_cend.pass.cpp
@@ -13,6 +13,8 @@
// const_iterator cbegin() const;
// const_iterator cend() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include <cstddef>
diff --git a/libcxx/test/std/re/re.results/re.results.acc/index.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/index.pass.cpp
index a5c25a82c81b1e..358b522e1a6042 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/index.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/index.pass.cpp
@@ -12,6 +12,8 @@
// const_reference operator[](size_type n) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/length.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/length.pass.cpp
index 266ba692ff4dc8..10fa92cdd6cb70 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/length.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/length.pass.cpp
@@ -12,6 +12,8 @@
// difference_type length(size_type sub = 0) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/position.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/position.pass.cpp
index 34256de3585cc0..c547e00ae1c9a2 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/position.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/position.pass.cpp
@@ -12,6 +12,8 @@
// difference_type position(size_type sub = 0) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/prefix.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/prefix.pass.cpp
index b2cd48d4db60aa..a4cbdddfbaaf3a 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/prefix.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/prefix.pass.cpp
@@ -12,6 +12,8 @@
// const_reference prefix() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/str.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/str.pass.cpp
index ae4387d463aa6d..3fa1e88f29787d 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/str.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/str.pass.cpp
@@ -12,6 +12,8 @@
// string_type str(size_type sub = 0) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp
index c9d3855e9bd74d..32657681cfb02f 100644
--- a/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp
@@ -12,6 +12,8 @@
// const_reference suffix() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
index 3ea03622272009..a63348650c9424 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
@@ -15,6 +15,8 @@
// format(OutputIter out, const char_type* fmt_first, const char_type* fmt_last,
// regex_constants::match_flag_type flags = regex_constants::format_default) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
index 3c9f04a7ca02a5..8ee4ebe3a8a2bf 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
@@ -15,6 +15,8 @@
// format(OutputIter out, const basic_string<char_type, ST, SA>& fmt,
// regex_constants::match_flag_type flags = regex_constants::format_default) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
index 384cf177b13cba..1f613ed1c70f7c 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
@@ -15,6 +15,8 @@
// format(const basic_string<char_type, ST, SA>& fmt,
// regex_constants::match_flag_type flags = regex_constants::format_default) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
diff --git a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
index 7bd25d98b2ba61..80bb1163d69b8c 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
@@ -14,6 +14,8 @@
// format(const char_type* fmt,
// regex_constants::match_flag_type flags = regex_constants::format_default) const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.nonmember/equal.pass.cpp b/libcxx/test/std/re/re.results/re.results.nonmember/equal.pass.cpp
index 1f01e95861fbcc..03180202cd8d8e 100644
--- a/libcxx/test/std/re/re.results/re.results.nonmember/equal.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.nonmember/equal.pass.cpp
@@ -20,6 +20,8 @@
// operator!=(const match_results<BidirectionalIterator, Allocator>& m1,
// const match_results<BidirectionalIterator, Allocator>& m2);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.size/empty.pass.cpp b/libcxx/test/std/re/re.results/re.results.size/empty.pass.cpp
index 7eaed34ac6ab88..b70082966e9222 100644
--- a/libcxx/test/std/re/re.results/re.results.size/empty.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.size/empty.pass.cpp
@@ -13,6 +13,8 @@
// size_type size() const;
// bool empty() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.state/ready.pass.cpp b/libcxx/test/std/re/re.results/re.results.state/ready.pass.cpp
index 476a66fdfba472..84ce5daabca467 100644
--- a/libcxx/test/std/re/re.results/re.results.state/ready.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.state/ready.pass.cpp
@@ -12,6 +12,8 @@
// bool ready() const;
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.swap/member_swap.pass.cpp b/libcxx/test/std/re/re.results/re.results.swap/member_swap.pass.cpp
index 967fe11c5ac4b3..401d65abda631a 100644
--- a/libcxx/test/std/re/re.results/re.results.swap/member_swap.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.swap/member_swap.pass.cpp
@@ -12,6 +12,8 @@
// void swap(match_results& that);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/re/re.results/re.results.swap/non_member_swap.pass.cpp b/libcxx/test/std/re/re.results/re.results.swap/non_member_swap.pass.cpp
index 59ba59f3d6493a..67572acc96cfb3 100644
--- a/libcxx/test/std/re/re.results/re.results.swap/non_member_swap.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.swap/non_member_swap.pass.cpp
@@ -14,6 +14,8 @@
// void swap(match_results<BidirectionalIterator, Allocator>& m1,
// match_results<BidirectionalIterator, Allocator>& m2);
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <regex>
#include <cassert>
#include "test_macros.h"
diff --git a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
index bedc5f19a6a881..c206c1ce8df45d 100644
--- a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
+++ b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
@@ -9,6 +9,8 @@
// <string>
// ... manipulating sequences of any non-array trivial standard-layout types.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <string>
#include "test_traits.h"
diff --git a/libcxx/test/std/strings/string.view/char.bad.verify.cpp b/libcxx/test/std/strings/string.view/char.bad.verify.cpp
index 735e3e5d2e7162..df917363881505 100644
--- a/libcxx/test/std/strings/string.view/char.bad.verify.cpp
+++ b/libcxx/test/std/strings/string.view/char.bad.verify.cpp
@@ -8,6 +8,8 @@
// UNSUPPORTED: !stdlib=libc++ && (c++03 || c++11 || c++14)
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
// <string_view>
// ... manipulating sequences of any non-array trivial standard-layout types.
diff --git a/libcxx/test/std/utilities/template.bitset/bitset.members/nonstdmem.uglified.compile.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/nonstdmem.uglified.compile.pass.cpp
index f1daa7c3dcce93..ae3ac819b1f9c6 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.members/nonstdmem.uglified.compile.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.members/nonstdmem.uglified.compile.pass.cpp
@@ -13,6 +13,8 @@
//
// See https://github.com/llvm/llvm-project/issues/111125.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <cstddef>
#include <bitset>
#include <type_traits>
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 7f50282d627176..676c865914b403 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -214,7 +214,11 @@
#define TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT
#endif
-#if defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_ALIGNED_ALLOCATION
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+# ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+# define TEST_HAS_NO_ALIGNED_ALLOCATION
+# endif
+#elif defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_ALIGNED_ALLOCATION
# define TEST_HAS_NO_ALIGNED_ALLOCATION
#elif TEST_STD_VER < 17 && (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606L)
# define TEST_HAS_NO_ALIGNED_ALLOCATION
@@ -262,7 +266,9 @@
#define TEST_IGNORE_NODISCARD (void)
-#if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+// from-chars is a C++17 feature, so it's never available anyways
+#elif !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_FROM_CHARS_FLOATING_POINT
# define TEST_HAS_FROM_CHARS_FLOATING_POINT
#endif
@@ -401,11 +407,19 @@ inline Tp const& DoNotOptimize(Tp const& value) {
# define TEST_HAS_NO_UNICODE
#endif
-#if defined(_LIBCPP_VERSION) && _LIBCPP_HAS_OPEN_WITH_WCHAR
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+# ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR
+# define TEST_HAS_OPEN_WITH_WCHAR
+# endif
+#elif defined(_LIBCPP_VERSION) && _LIBCPP_HAS_OPEN_WITH_WCHAR
# define TEST_HAS_OPEN_WITH_WCHAR
#endif
-#if (defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_INT128) || defined(_MSVC_STL_VERSION)
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+# ifdef _LIBCPP_HAS_NO_INT128
+# define TEST_HAS_NO_INT128
+# endif
+#elif (defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_INT128) || defined(_MSVC_STL_VERSION)
# define TEST_HAS_NO_INT128
#endif
@@ -425,7 +439,11 @@ inline Tp const& DoNotOptimize(Tp const& value) {
# define TEST_HAS_NO_FILESYSTEM
#endif
-#if defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_C8RTOMB_MBRTOC8
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+# ifdef _LIBCPP_HAS_NO_C8RTOMB_MBRTOC8
+# define TEST_HAS_NO_C8RTOMB_MBRTOC8
+# endif
+#elif defined(_LIBCPP_VERSION) && !_LIBCPP_HAS_C8RTOMB_MBRTOC8
# define TEST_HAS_NO_C8RTOMB_MBRTOC8
#endif
@@ -499,7 +517,9 @@ inline Tp const& DoNotOptimize(Tp const& value) {
#endif
// Clang-18 has support for deducing this, but it does not set the FTM.
-#if defined(_LIBCPP_VERSION) && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
+#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
+// This is a C++20 featue, so we don't care whether the compiler could support it
+#elif defined(_LIBCPP_VERSION) && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# define TEST_HAS_EXPLICIT_THIS_PARAMETER
#endif
diff --git a/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp b/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp
index 15093a4357bb7d..ebd0d8892fa94c 100644
--- a/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp
+++ b/libcxx/test/tools/clang_tidy_checks/proper_version_checks.cpp
@@ -39,6 +39,9 @@ class proper_version_checks_callbacks : public clang::PPCallbacks {
if (preprocessor_.getSourceManager().isInMainFile(location))
return;
+ if (condition == "__cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)")
+ 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");
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index a832380e16cd83..96745c716e8920 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -281,6 +281,12 @@ check-generated-output)
#
# Various Standard modes
#
+frozen-cxx03-headers)
+ clean
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/frozen-cxx03-headers.cmake"
+ check-runtimes
+ check-abi-list
+;;
generic-cxx03)
clean
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 53fd44291b216a..2a18e4548a6bb9 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -2233,13 +2233,17 @@ def version_header(self) -> str:
#ifndef _LIBCPP_VERSION
#define _LIBCPP_VERSION
-#include <__config>
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/version>
+#else
+# include <__config>
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
{feature_test_macros}
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_VERSION
"""
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 2c5cb169c0a9a3..947cfd26513643 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -448,5 +448,12 @@ def getSuitableClangTidy(cfg):
AddSubstitution('%{clang-tidy}', exe),
]
),
+ Parameter(
+ name='test_frozen_cxx03_headers',
+ type=bool,
+ default=False,
+ help="Whether to test the main or C++03-specific headers. Only changes behaviour when std=c++03.",
+ actions=lambda enabled: [] if not enabled else [AddFlag("-D_LIBCPP_USE_FROZEN_CXX03_HEADERS"), AddFeature("FROZEN-CXX03-HEADERS-FIXME")],
+ ),
]
# fmt: on
diff --git a/libcxx/vendor/llvm/default_assertion_handler.in b/libcxx/vendor/llvm/default_assertion_handler.in
index e12ccccdaff37f..1d6b21fc6bb456 100644
--- a/libcxx/vendor/llvm/default_assertion_handler.in
+++ b/libcxx/vendor/llvm/default_assertion_handler.in
@@ -10,8 +10,13 @@
#ifndef _LIBCPP___ASSERTION_HANDLER
#define _LIBCPP___ASSERTION_HANDLER
-#include <__config>
-#include <__verbose_abort>
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/__config>
+# include <__cxx03/__verbose_abort>
+#else
+# include <__config>
+# include <__verbose_abort>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
More information about the llvm-branch-commits
mailing list