[libcxx-commits] [clang] [libcxx] [clang][WIP] std::embed and #depend implementation (PR #190578)
The Phantom Derpstorm via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 1 11:34:50 PDT 2026
https://github.com/ThePhD updated https://github.com/llvm/llvm-project/pull/190578
>From 346716f4902c85735f34119d9d1595e73ac3882c Mon Sep 17 00:00:00 2001
From: ThePhD <phdofthehouse at gmail.com>
Date: Wed, 1 Apr 2026 19:06:16 +0200
Subject: [PATCH 1/2] =?UTF-8?q?[clang][Lex][Sema]=20=E2=9C=A8=20Full=20std?=
=?UTF-8?q?::embed=20and=20#depend=20implementation?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- [clang][Lex][Sema] 🎨 Change how the builtin returns information by adding a new first argument
- [libcxx] 🎨 add a proper C++29 / __cplusplus-based version macro (embed is still 1 because even -std=c++2c does not change the value much higher)
- [clang][Lex][Sema] 🎨 clang-format
- [clang][Frontend] 🐛 Synchronize with Dependency File Collection Improvements
- [clang][AST][Sema] 🎨 rename to clang-specific builtin (no real agreement with GCC after all)
- [clang][doc][AST][Sema] 🎨 managed to make both the same for GCC, we are back on!
- [libc++][clang][doc][AST] 🎨🐛 synchronize and update return values
- [clang][doc] 🐛 fix improper string and code quote sequences in builtin std embed documentation
- [clang][AST][Sema] ✨ Add new locus argument to allow for any implementation to determine how many steps up they want to go in the constexpr callstack
- [clang][AST][Sema][Frontend] Adjust the dependency file checking to output appropriate data
- [libc++][clang-SemaCXX][clang-Preprocessor] ✅ Add a new tests
- [clang][Lex] 📝 It turns out Clang does not fully do Preprocessing before doing the rest of processing. That's a bit of a shame.
- [clang][Frontend] ✨ C++2d flags for when Clang is finally ready
---
clang/docs/CommandGuide/clang.rst | 8 +
clang/docs/LanguageExtensions.rst | 93 +
clang/docs/ReleaseNotes.rst | 3 +
clang/docs/ReleaseNotesTemplate.txt | 3 +
clang/include/clang/AST/ASTContext.h | 15 +
clang/include/clang/Basic/Builtins.td | 7 +
clang/include/clang/Basic/DiagnosticGroups.td | 14 +-
.../include/clang/Basic/DiagnosticLexKinds.td | 3 +
.../clang/Basic/DiagnosticSemaKinds.td | 5 +
.../clang/Basic/InputDependencyCollection.h | 66 +
clang/include/clang/Basic/LangOptions.def | 1 +
clang/include/clang/Basic/LangStandard.h | 28 +-
clang/include/clang/Basic/LangStandards.def | 17 +-
clang/include/clang/Basic/ResourceSearch.h | 37 +
clang/include/clang/Basic/TokenKinds.def | 2 +
clang/include/clang/Lex/PPCallbacks.h | 18 +
clang/include/clang/Lex/Preprocessor.h | 11 +
clang/include/clang/Sema/Sema.h | 1 +
clang/lib/AST/ASTContext.cpp | 14 +
clang/lib/AST/ExprConstant.cpp | 329 ++-
clang/lib/Basic/CMakeLists.txt | 2 +
clang/lib/Basic/IdentifierTable.cpp | 1 +
clang/lib/Basic/InputDependencyCollection.cpp | 191 ++
clang/lib/Basic/LangOptions.cpp | 1 +
clang/lib/Basic/ResourceSearch.cpp | 107 +
clang/lib/Frontend/ASTUnit.cpp | 8 +-
clang/lib/Frontend/CompilerInstance.cpp | 2 +
clang/lib/Frontend/DependencyFile.cpp | 101 +-
clang/lib/Lex/PPDirectives.cpp | 124 +-
clang/lib/Lex/Preprocessor.cpp | 36 +-
clang/lib/Sema/SemaChecking.cpp | 146 ++
clang/test/Driver/unknown-std.cpp | 6 +-
.../Inputs/media/nested/inside.txt | 1 +
.../test/Preprocessor/depend-dependencies.cpp | 11 +
.../depend-export-dependencies.cpp | 13 +
.../depend-recursive-dependencies.cpp | 12 +
clang/test/SemaCXX/Inputs/resources/a/b/empty | 0
clang/test/SemaCXX/Inputs/resources/art.bin | 1 +
.../consteval-builtin-std-embed-art.cpp | 198 ++
.../consteval-builtin-std-embed-errors.cpp | 42 +
...consteval-builtin-std-embed-local_file.cpp | 73 +
.../SemaCXX/consteval-builtin-std-embed.cpp | 186 ++
.../clang-import-test/clang-import-test.cpp | 2 +
clang/unittests/Lex/PPCallbacksTest.cpp | 1 +
clang/www/OpenProjects.html | 2 +-
clang/www/cxx_status.html | 6 +
libcxx/docs/FeatureTestMacroTable.rst | 4 +
libcxx/docs/Status/Cxx2d.rst | 43 +
libcxx/docs/Status/Cxx2dIssues.csv | 2 +
libcxx/docs/Status/Cxx2dIssues.csvgb | 0
libcxx/docs/Status/Cxx2dPapers.csv | 3 +
libcxx/docs/index.rst | 2 +
libcxx/include/CMakeLists.txt | 1 +
libcxx/include/__configuration/language.h | 6 +-
libcxx/include/embed | 175 ++
libcxx/include/version | 5 +
libcxx/test/std/embed/a.txt | 1 +
.../test/std/embed/embed-mandates.verify.cpp | 34 +
.../test/std/embed/embed-nodiscard.verify.cpp | 43 +
.../std/embed/embed-post-conditions.pass.cpp | 50 +
libcxx/test/std/embed/empty | 0
.../algorithm.version.compile.pass.cpp | 108 +-
.../any.version.compile.pass.cpp | 13 +-
.../array.version.compile.pass.cpp | 40 +-
.../atomic.version.compile.pass.cpp | 94 +-
.../barrier.version.compile.pass.cpp | 19 +-
.../bit.version.compile.pass.cpp | 41 +-
.../bitset.version.compile.pass.cpp | 20 +-
.../charconv.version.compile.pass.cpp | 26 +-
.../chrono.version.compile.pass.cpp | 20 +-
.../cmath.version.compile.pass.cpp | 46 +-
.../compare.version.compile.pass.cpp | 13 +-
.../complex.version.compile.pass.cpp | 20 +-
.../concepts.version.compile.pass.cpp | 13 +-
.../coroutine.version.compile.pass.cpp | 13 +-
.../cstddef.version.compile.pass.cpp | 13 +-
.../cstdlib.version.compile.pass.cpp | 19 +-
.../cstring.version.compile.pass.cpp | 19 +-
.../deque.version.compile.pass.cpp | 47 +-
.../embed.version.compile.pass.cpp | 68 +
.../exception.version.compile.pass.cpp | 13 +-
.../execution.version.compile.pass.cpp | 32 +-
.../expected.version.compile.pass.cpp | 33 +-
.../filesystem.version.compile.pass.cpp | 45 +-
.../flat_map.version.compile.pass.cpp | 20 +-
.../flat_set.version.compile.pass.cpp | 20 +-
.../format.version.compile.pass.cpp | 33 +-
.../forward_list.version.compile.pass.cpp | 68 +-
.../fstream.version.compile.pass.cpp | 19 +-
.../functional.version.compile.pass.cpp | 136 +-
.../iomanip.version.compile.pass.cpp | 19 +-
.../ios.version.compile.pass.cpp | 13 +-
.../istream.version.compile.pass.cpp | 19 +-
.../iterator.version.compile.pass.cpp | 62 +-
.../latch.version.compile.pass.cpp | 19 +-
.../limits.version.compile.pass.cpp | 19 +-
.../list.version.compile.pass.cpp | 68 +-
.../locale.version.compile.pass.cpp | 19 +-
.../map.version.compile.pass.cpp | 94 +-
.../mdspan.version.compile.pass.cpp | 46 +-
.../memory.version.compile.pass.cpp | 145 +-
.../memory_resource.version.compile.pass.cpp | 32 +-
.../mutex.version.compile.pass.cpp | 19 +-
.../new.version.compile.pass.cpp | 46 +-
.../numbers.version.compile.pass.cpp | 13 +-
.../numeric.version.compile.pass.cpp | 54 +-
.../optional.version.compile.pass.cpp | 46 +-
.../ostream.version.compile.pass.cpp | 32 +-
.../print.version.compile.pass.cpp | 19 +-
.../queue.version.compile.pass.cpp | 27 +-
.../random.version.compile.pass.cpp | 32 +-
.../ranges.version.compile.pass.cpp | 127 +-
.../ratio.version.compile.pass.cpp | 13 +-
.../regex.version.compile.pass.cpp | 13 +-
.../scoped_allocator.version.compile.pass.cpp | 13 +-
.../semaphore.version.compile.pass.cpp | 19 +-
.../set.version.compile.pass.cpp | 74 +-
.../shared_mutex.version.compile.pass.cpp | 32 +-
.../source_location.version.compile.pass.cpp | 13 +-
.../span.version.compile.pass.cpp | 38 +-
.../sstream.version.compile.pass.cpp | 13 +-
.../stack.version.compile.pass.cpp | 20 +-
.../stdatomic.h.version.compile.pass.cpp | 13 +-
.../stop_token.version.compile.pass.cpp | 19 +-
.../string.version.compile.pass.cpp | 122 +-
.../string_view.version.compile.pass.cpp | 67 +-
.../syncstream.version.compile.pass.cpp | 19 +-
.../thread.version.compile.pass.cpp | 32 +-
.../tuple.version.compile.pass.cpp | 68 +-
.../type_traits.version.compile.pass.cpp | 224 +-
.../typeinfo.version.compile.pass.cpp | 13 +-
.../unordered_map.version.compile.pass.cpp | 94 +-
.../unordered_set.version.compile.pass.cpp | 74 +-
.../utility.version.compile.pass.cpp | 103 +-
.../variant.version.compile.pass.cpp | 33 +-
.../vector.version.compile.pass.cpp | 61 +-
.../version.version.compile.pass.cpp | 2035 ++++++++++++++++-
.../generate_feature_test_macro_components.py | 7 +-
138 files changed, 7342 insertions(+), 248 deletions(-)
create mode 100644 clang/include/clang/Basic/InputDependencyCollection.h
create mode 100644 clang/include/clang/Basic/ResourceSearch.h
create mode 100644 clang/lib/Basic/InputDependencyCollection.cpp
create mode 100644 clang/lib/Basic/ResourceSearch.cpp
create mode 100644 clang/test/Preprocessor/Inputs/media/nested/inside.txt
create mode 100644 clang/test/Preprocessor/depend-dependencies.cpp
create mode 100644 clang/test/Preprocessor/depend-export-dependencies.cpp
create mode 100644 clang/test/Preprocessor/depend-recursive-dependencies.cpp
create mode 100644 clang/test/SemaCXX/Inputs/resources/a/b/empty
create mode 100644 clang/test/SemaCXX/Inputs/resources/art.bin
create mode 100644 clang/test/SemaCXX/consteval-builtin-std-embed-art.cpp
create mode 100644 clang/test/SemaCXX/consteval-builtin-std-embed-errors.cpp
create mode 100644 clang/test/SemaCXX/consteval-builtin-std-embed-local_file.cpp
create mode 100644 clang/test/SemaCXX/consteval-builtin-std-embed.cpp
create mode 100644 libcxx/docs/Status/Cxx2d.rst
create mode 100644 libcxx/docs/Status/Cxx2dIssues.csv
create mode 100644 libcxx/docs/Status/Cxx2dIssues.csvgb
create mode 100644 libcxx/docs/Status/Cxx2dPapers.csv
create mode 100644 libcxx/include/embed
create mode 100644 libcxx/test/std/embed/a.txt
create mode 100644 libcxx/test/std/embed/embed-mandates.verify.cpp
create mode 100644 libcxx/test/std/embed/embed-nodiscard.verify.cpp
create mode 100644 libcxx/test/std/embed/embed-post-conditions.pass.cpp
create mode 100644 libcxx/test/std/embed/empty
create mode 100644 libcxx/test/std/language.support/support.limits/support.limits.general/embed.version.compile.pass.cpp
diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst
index d8c70bdc43b18..c4dcca3d093fd 100644
--- a/clang/docs/CommandGuide/clang.rst
+++ b/clang/docs/CommandGuide/clang.rst
@@ -226,6 +226,14 @@ Language Selection and Mode Options
Working draft for C++2c with GNU extensions
+ | ``c++2d``
+
+ Working draft for C++2d
+
+ | ``gnu++2d``
+
+ Working draft for C++2d with GNU extensions
+
The default C++ language standard is ``gnu++17``.
Supported values for the OpenCL language are:
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index e2e98604008ea..5d6919d2eab84 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -5474,6 +5474,99 @@ manner as the above four builtins, except that ``_M_function_name`` is populated
with ``__PRETTY_FUNCTION__`` rather than ``__FUNCTION__``.
+Data embedding builtin ``__builtin_std_embed``
+----------------------------------------------
+
+For use with `p1040's <https://wg21.link/p1040>`_ ``std::embed`` function. It
+is conceptually (but not exactly) represented by the following template
+function overloads:
+
+**Syntax**
+
+.. code-block:: c++
+
+ template <class Byte, class Char>
+ Byte const* __builtin_std_embed(unsigned int locus, int& status,
+ size_t& size, T const* indicator_ptr,
+ size_t resource_name_size,
+ Char const* resource_name_ptr,
+ size_t offset);
+
+ template <class Byte, class Char>
+ Byte const* __builtin_std_embed(unsigned int locus, int& status,
+ size_t& size, T const* indicator_ptr,
+ size_t resource_name_size,
+ Char const* resource_name_ptr,
+ size_t offset, size_t limit);
+
+The ``locus`` argument is always ``1`` and is significant for implementers
+only. If you are asking the question "am I an implementer?", you are not an
+implementer and you should be passing in a value equivalent to ``1``. If
+you can answer this in the affirmative, ``locus`` can be broken down as
+``do-local-search = (locus & 0x1)`` and ``call-local-distance = (locus >> 1)``.
+``do-local-search`` is whether or not a search from the local file is performed.
+``call-stack-distance`` is the distance that this builtin call is removed from
+where a normal user would be interfacing with this builtin, for the purpose of
+file search. For example, from within the depths of a ``std::embed`` call,
+``locus`` would likely be ``0b101`` or ``0b111``.
+
+The ``status`` argument is an output parameter status object. It will be
+filled with:
+
+- ``0`` is the file is not found.
+- ``1`` if the file is found, properly ``#depend``-ed on, and not empty.
+- ``2`` if the file is found but not suitably ``#depend``-ed on,
+- or, ``3`` if the file is found, properly ``#depend``-ed on, but it was empty.
+
+The ``size`` argument is an output parameter for the number of elements pointed
+to by the return type. If ``limit`` is provided, this value will be less than
+or equal to ``limit``.
+
+The ``indicator_ptr`` argument is a type hint for the type to return. It must
+be a pointer to a ``const`` type, and ``Byte`` must an integral or enumeration
+type with an alignment and size of ``1`` (e.g. ``char``, ``unsigned char``,
+``std::byte``, etc.). A future extension can possibly allow for additional
+types, possibly all types which are considered "trivial" types (but without
+pointers inside).
+
+The ``resource_name_...`` arguments describe a plain, wide, or ``char8_t``
+range as as string. ``Char`` can be one of ``char``, ``wchar_t``, or
+``char8_t`` to represent a string in the literal encoding, wide literal
+encoding, or UTF-8 encoding respectively. While they have these stated
+encodings, the plain, wide (when ``sizeof(wchar_t) == 1``), and ``char8_t``
+strings are passed as-is to internal file handling solutions. ``wchar_t``
+string ranges where it is 16-bits wide or 32-bits wide assume it is encoded as
+UTF-16 or UTF-32, respectively, and attempt to transcode to UTF-8. This means
+some files may not be representable when using wide strings. This behavior is
+subject to change, for example if the ``-fexec-charset=Encoding-Name`` or
+``-fwide-exec-charset=Encoding-Name`` options are implemented. It is also
+subject to change based on other factors, such as whether it is advantageous
+to produce a hard error on failed conversion or try the search anyway using
+canonical replacement characters (such as ``'\u{FFFD}'`` or ``'?'``).
+
+The seventh argument is the offset in bytes into the file. It can be set to
+``0`` to have no effect. This represents the number of ``Byte`` objects
+that will be discarded from the start of the file stream.
+
+The ``limit`` argument is optional, and represents a fixed upper limit on the count
+of ``Byte`` objects that the returned value will point to. Less values can be
+pointed to by the return value than what ``limit`` describes.
+
+The ``offset`` value is applied before any ``limit`` is taken into
+consideration. Both values can make a file that has binary data be considered
+empty. The file name represented by the string range is searched in the
+same way as ``#embed`` files, with the caveat that any file not blessed by
+``#depend`` will be treated as a file that is not found. All searches done are
+searches as-if done by a quoted header name for a ``#embed`` directive.
+
+The data returned may not be unique, may prefix into other data, and has no
+guarantee that caching may apply. That is, calling ``__builtin_std_embed`` with
+the exact same arguments twice may return two different pointers or the same
+pointer, and is subject to everything from optimization level, implementation
+effort, and whether or not it is sunny outside right now. Block devices such
+as ``/dev/urandom`` can possibly be supported in the future.
+
+
Alignment builtins
------------------
Clang provides builtins to support checking and adjusting alignment of
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index c408196c3816b..df866b880fe77 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -141,6 +141,9 @@ C++ Language Changes
- ``__is_trivially_equality_comparable`` no longer returns false for all enum types. (#GH132672)
+C++2d Feature Support
+^^^^^^^^^^^^^^^^^^^^^
+
C++2c Feature Support
^^^^^^^^^^^^^^^^^^^^^
diff --git a/clang/docs/ReleaseNotesTemplate.txt b/clang/docs/ReleaseNotesTemplate.txt
index b5664dcf3b212..0c588c3b4f43a 100644
--- a/clang/docs/ReleaseNotesTemplate.txt
+++ b/clang/docs/ReleaseNotesTemplate.txt
@@ -61,6 +61,9 @@ What's New in Clang |release|?
C++ Language Changes
--------------------
+C++2d Feature Support
+^^^^^^^^^^^^^^^^^^^^^
+
C++2c Feature Support
^^^^^^^^^^^^^^^^^^^^^
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index c45d54fdd2e88..f93fb18bbf7d5 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -27,6 +27,7 @@
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeOrdering.h"
+#include "clang/Basic/InputDependencyCollection.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
@@ -132,6 +133,7 @@ class OMPTraitInfo;
class ParentMapContext;
struct ParsedTargetAttr;
class Preprocessor;
+class PreprocessorOptions;
class ProfileList;
class StoredDeclsMap;
class TargetAttr;
@@ -568,6 +570,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
// A mapping from Scalable Vector Type keys to their corresponding QualType.
mutable llvm::DenseMap<llvm::ScalableVecTyKey, QualType> ScalableVecTyMap;
+ // Same preprocessor options from other lexers, so we can look up
+ // embedded files
+ PreprocessorOptions const *PPOpts = nullptr;
+
ASTContext &this_() { return *this; }
public:
@@ -809,6 +815,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
mutable DeclarationNameTable DeclarationNames;
IntrusiveRefCntPtr<ExternalASTSource> ExternalSource;
ASTMutationListener *Listener = nullptr;
+ std::shared_ptr<InputDependencyCollection> InputDependencyPatterns =
+ std::make_shared<InputDependencyCollection>();
/// Returns the clang bytecode interpreter context.
interp::Context &getInterpContext() const;
@@ -1413,6 +1421,13 @@ class ASTContext : public RefCountedBase<ASTContext> {
ASTContext &operator=(const ASTContext &) = delete;
~ASTContext();
+ /// Set the preprocessor options to use right now
+ void setCurrentPreprocessorOptions(PreprocessorOptions const *NewPPOpts);
+ void setCurrentPreprocessorOptions(const PreprocessorOptions &NewPPOpts);
+
+ /// Get the preprocessor options we are using. Can be null!
+ PreprocessorOptions const *getCurrentPreprocessorOptions() const;
+
/// Attach an external AST source to the AST context.
///
/// The external AST source provides the ability to load parts of
diff --git a/clang/include/clang/Basic/Builtins.td b/clang/include/clang/Basic/Builtins.td
index 4a7eaeb3d353e..95f1a7e8f9e41 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -1269,6 +1269,13 @@ def GetVtablePointer : LangBuiltin<"CXX_LANG"> {
let Prototype = "void*(void*)";
}
+// p1040 std::embed
+def StdEmbed : Builtin {
+ let Spellings = ["__builtin_std_embed"];
+ let Attributes = [NoThrow, Const, Consteval];
+ let Prototype = "void const*(unsigned int, int&, size_t&, ...)";
+}
+
// GCC exception builtins
def EHReturn : Builtin {
let Spellings = ["__builtin_eh_return"];
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 2b3055d6d6bdd..b5d8fc7cd7334 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -410,8 +410,9 @@ def CXXPre23CompatPedantic :
def CXXPre26Compat : DiagGroup<"pre-c++26-compat">;
def CXXPre26CompatPedantic :
DiagGroup<"pre-c++26-compat-pedantic", [CXXPre26Compat]>;
-def : DiagGroup<"pre-c++2c-compat", [CXXPre26Compat]>;
-def : DiagGroup<"pre-c++2c-compat-pedantic", [CXXPre26CompatPedantic]>;
+def CXXPre29Compat : DiagGroup<"pre-c++2d-compat">;
+def CXXPre29CompatPedantic :
+ DiagGroup<"pre-c++2d-compat-pedantic", [CXXPre29Compat]>;
def CXX98CompatBindToTemporaryCopy :
DiagGroup<"c++98-compat-bind-to-temporary-copy">;
@@ -528,6 +529,8 @@ def CXX23Compat : DiagGroup<"c++23-compat", [CXXPre26Compat]>;
def CXX26Compat : DiagGroup<"c++2c-compat", [DeleteIncomplete]>;
+def CXX29Compat : DiagGroup<"c++2d-compat", [DeleteIncomplete]>;
+
def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
def FourByteMultiChar : DiagGroup<"four-char-constants">;
@@ -1526,12 +1529,17 @@ def CXX23 : DiagGroup<"c++23-extensions", [CXX23AttrsOnLambda]>;
// earlier C++ versions.
def CXX26 : DiagGroup<"c++26-extensions">;
+// A warning group for warnings about using C++29 features as extensions in
+// earlier C++ versions.
+def CXX29 : DiagGroup<"c++29-extensions">;
+
def : DiagGroup<"c++0x-extensions", [CXX11]>;
def : DiagGroup<"c++1y-extensions", [CXX14]>;
def : DiagGroup<"c++1z-extensions", [CXX17]>;
def : DiagGroup<"c++2a-extensions", [CXX20]>;
def : DiagGroup<"c++2b-extensions", [CXX23]>;
-def : DiagGroup<"c++2c-extensions", [CXX26]>;
+def CXX2C : DiagGroup<"c++2c-extensions", [CXX26]>;
+def CXX2D : DiagGroup<"c++2d-extensions", [CXX29]>;
def DelegatingCtorCycles :
DiagGroup<"delegating-ctor-cycles">;
diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td
index 85fa290de6fd9..0e5ab7c7bfd9b 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -467,6 +467,8 @@ def warn_c23_compat_warning_directive : Warning<
def ext_pp_embed_directive : ExtWarn<
"#embed is a %select{C23|Clang}0 extension">,
InGroup<C23>;
+def ext_pp_depend_directive : ExtWarn<
+ "#depend is a C++2d extension">, InGroup<CXX2D>;
def warn_compat_pp_embed_directive : Warning<
"#embed is incompatible with C standards before C23">,
InGroup<CPre23Compat>, DefaultIgnore;
@@ -582,6 +584,7 @@ def err_pp_including_mainfile_in_preamble : Error<
def err_pp_empty_filename : Error<"empty filename">;
def err_pp_include_too_deep : Error<"#include nested too deeply">;
def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;
+def err_pp_expects_pattern : Error<"expected \"PATTERN\" or <PATTERN>">;
def err_pp_macro_not_identifier : Error<"macro name must be an identifier">;
def err_pp_missing_macro_name : Error<"macro name missing">;
def err_pp_missing_rparen_in_macro_def : Error<
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 1302c4296885b..bc9538751f7f9 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -850,6 +850,11 @@ def err_builtin_definition : Error<"definition of builtin function %0">;
def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">;
def err_invalid_builtin_argument : Error<"invalid argument '%0' to %1">;
+/// __builtin_std_embed type checking errors
+def err_invalid_builtin_std_embed_argument : Error<
+ "invalid argument to '__builtin_std_embed': %0 should be %1">;
+
+
def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
def err_arm_invalid_coproc : Error<"coprocessor %0 must be configured as "
"%select{GCP|CDE}1">;
diff --git a/clang/include/clang/Basic/InputDependencyCollection.h b/clang/include/clang/Basic/InputDependencyCollection.h
new file mode 100644
index 0000000000000..d29a9e4192f37
--- /dev/null
+++ b/clang/include/clang/Basic/InputDependencyCollection.h
@@ -0,0 +1,66 @@
+//===--- InputDependencyCollection.h - Searching for Resources --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// User-provided filters include/exclude profile instrumentation in certain
+// functions.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_BASIC_INPUTDEPENDENCYCOLLECTION_H
+#define LLVM_CLANG_BASIC_INPUTDEPENDENCYCOLLECTION_H
+
+#include "clang/Basic/FileEntry.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Regex.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+
+class FileManager;
+
+/// How to handle various forms of input dependency root patterns for search
+/// purposes.
+enum class RootPatternScanType {
+ None = 0b00,
+ Directory = 0b01,
+ RecursiveDirectory = 0b10,
+ DirectoryAndRecursiveDirectory = 0b11
+};
+
+struct PatternFilter {
+ std::string Input;
+ std::string SearchRoot;
+ std::string PatternRoot;
+ std::string Pattern;
+ llvm::Regex PatternRegex;
+ RootPatternScanType RootHandling;
+ bool Exported;
+
+ PatternFilter(std::string Input);
+
+ bool Check(StringRef Filename) const;
+};
+
+class InputDependencyCollection {
+private:
+ std::vector<PatternFilter> PatternFilters;
+
+ static PatternFilter ComputeFilter(std::string Pattern, bool Exported);
+
+public:
+ InputDependencyCollection() = default;
+
+ PatternFilter &Add(std::string Pattern, bool IsAngled, bool Exported,
+ FileManager &FM,
+ const std::vector<std::string> &SearchEntries,
+ OptionalFileEntryRef LookupFrom);
+ bool Check(llvm::StringRef Filename) const;
+};
+} // namespace clang
+
+#endif
diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index 596bce9e897f7..5d685b9c91732 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -57,6 +57,7 @@ LANGOPT(CPlusPlus17 , 1, 0, NotCompatible, "C++17")
LANGOPT(CPlusPlus20 , 1, 0, NotCompatible, "C++20")
LANGOPT(CPlusPlus23 , 1, 0, NotCompatible, "C++23")
LANGOPT(CPlusPlus26 , 1, 0, NotCompatible, "C++26")
+LANGOPT(CPlusPlus29 , 1, 0, NotCompatible, "C++29")
LANGOPT(ObjC , 1, 0, NotCompatible, "Objective-C")
LANGOPT(ObjCDefaultSynthProperties , 1, 0, Benign,
"Objective-C auto-synthesized properties")
diff --git a/clang/include/clang/Basic/LangStandard.h b/clang/include/clang/Basic/LangStandard.h
index 1eef3a6339299..7e9cf43bda334 100644
--- a/clang/include/clang/Basic/LangStandard.h
+++ b/clang/include/clang/Basic/LangStandard.h
@@ -52,18 +52,19 @@ enum LangFeatures {
C17 = (1 << 3),
C23 = (1 << 4),
C2y = (1 << 5),
- CPlusPlus = (1 << 6),
- CPlusPlus11 = (1 << 7),
- CPlusPlus14 = (1 << 8),
- CPlusPlus17 = (1 << 9),
- CPlusPlus20 = (1 << 10),
- CPlusPlus23 = (1 << 11),
- CPlusPlus26 = (1 << 12),
- Digraphs = (1 << 13),
- GNUMode = (1 << 14),
- HexFloat = (1 << 15),
- OpenCL = (1 << 16),
- HLSL = (1 << 17)
+ CPlusPlus = (1 << 8),
+ CPlusPlus11 = (1 << 9),
+ CPlusPlus14 = (1 << 10),
+ CPlusPlus17 = (1 << 11),
+ CPlusPlus20 = (1 << 12),
+ CPlusPlus23 = (1 << 13),
+ CPlusPlus26 = (1 << 14),
+ CPlusPlus29 = (1 << 15),
+ Digraphs = (1 << 20),
+ GNUMode = (1 << 21),
+ HexFloat = (1 << 22),
+ OpenCL = (1 << 23),
+ HLSL = (1 << 24)
};
/// LangStandard - Information about the properties of a particular language
@@ -133,6 +134,9 @@ struct LangStandard {
/// isCPlusPlus26 - Language is a post-C++26 variant (or later).
bool isCPlusPlus26() const { return Flags & CPlusPlus26; }
+ /// isCPlusPlus2c - Language is a C++2c (expected 2029) variant (or later).
+ bool isCPlusPlus29() const { return Flags & CPlusPlus29; }
+
/// hasDigraphs - Language supports digraphs.
bool hasDigraphs() const { return Flags & Digraphs; }
diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def
index 4edc93503cdf5..476c9ff55254a 100644
--- a/clang/include/clang/Basic/LangStandards.def
+++ b/clang/include/clang/Basic/LangStandards.def
@@ -180,17 +180,30 @@ LANGSTANDARD_ALIAS_DEPR(gnucxx23, "gnu++2b")
// FIXME: Use correct version code for C++26 once published.
LANGSTANDARD(cxx26, "c++2c",
- CXX, "Working draft for C++2c",
+ CXX, "Working draft for C++26",
LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat, 202400)
LANGSTANDARD_ALIAS(cxx26, "c++26")
LANGSTANDARD(gnucxx26, "gnu++2c",
- CXX, "Working draft for C++2c with GNU extensions",
+ CXX, "Working draft for C++26 with GNU extensions",
LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode, 202400)
LANGSTANDARD_ALIAS(gnucxx26, "gnu++26")
+// FIXME: Use correct version code for C++29 once published.
+LANGSTANDARD(cxx29, "c++2d",
+ CXX, "Working draft for C++2d",
+ LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
+ CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | CPlusPlus29 | Digraphs | HexFloat, 202604)
+LANGSTANDARD_ALIAS(cxx29, "c++29")
+
+LANGSTANDARD(gnucxx29, "gnu++2d",
+ CXX, "Working draft for C++2d with GNU extensions",
+ LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
+ CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | CPlusPlus29 | Digraphs | HexFloat | GNUMode, 202604)
+LANGSTANDARD_ALIAS(gnucxx29, "gnu++29")
+
// OpenCL
LANGSTANDARD(opencl10, "cl1.0",
OpenCL, "OpenCL 1.0",
diff --git a/clang/include/clang/Basic/ResourceSearch.h b/clang/include/clang/Basic/ResourceSearch.h
new file mode 100644
index 0000000000000..3db353405b2ce
--- /dev/null
+++ b/clang/include/clang/Basic/ResourceSearch.h
@@ -0,0 +1,37 @@
+//===--- ResourceSearch.h - Searching for Resources -------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// User-provided filters include/exclude profile instrumentation in certain
+// functions.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_BASIC_RESOURCESEARCH_H
+#define LLVM_CLANG_BASIC_RESOURCESEARCH_H
+
+#include "clang/Basic/FileEntry.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/StringRef.h"
+#include <memory>
+#include <optional>
+
+namespace clang {
+
+class FileManager;
+
+OptionalFileEntryRef
+LookupFileWithStdVec(StringRef Filename, bool isAngled, bool OpenFile,
+ FileManager &FM,
+ const std::vector<std::string> &SearchEntries,
+ OptionalFileEntryRef LookupFromFile);
+OptionalFileEntryRef LookupFileWith(StringRef Filename, bool isAngled,
+ bool OpenFile, FileManager &FM,
+ ArrayRef<StringRef> SearchEntries,
+ OptionalFileEntryRef LookupFromFile);
+} // namespace clang
+
+#endif
diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def
index 005d81b5b9282..c73127ab9d97b 100644
--- a/clang/include/clang/Basic/TokenKinds.def
+++ b/clang/include/clang/Basic/TokenKinds.def
@@ -132,6 +132,8 @@ PPKEYWORD(pragma)
// C23 & C++26 #embed
PPKEYWORD(embed)
+// C++29 #depend
+PPKEYWORD(depend)
// C++20 Module Directive
PPKEYWORD(module)
diff --git a/clang/include/clang/Lex/PPCallbacks.h b/clang/include/clang/Lex/PPCallbacks.h
index 51c6a31e143b8..0d8e1375fd2ce 100644
--- a/clang/include/clang/Lex/PPCallbacks.h
+++ b/clang/include/clang/Lex/PPCallbacks.h
@@ -29,6 +29,7 @@ class MacroDefinition;
class MacroDirective;
class MacroArgs;
struct LexEmbedParametersResult;
+struct PatternFilter;
/// This interface provides a way to observe the actions of the
/// preprocessor as it does its thing.
@@ -175,6 +176,12 @@ class PPCallbacks {
bool ModuleImported,
SrcMgr::CharacteristicKind FileType) {}
+ /// Hook called when a 'depend' directive is read.
+ virtual void DependDirective(SourceLocation HashLoc, const Token &DependTok,
+ StringRef FileName, bool IsAngled,
+ const PatternFilter &Filter,
+ OptionalFileEntryRef CurrentFile) {}
+
/// Callback invoked whenever a submodule was entered.
///
/// \param M The submodule we have entered.
@@ -543,6 +550,17 @@ class PPChainedCallbacks : public PPCallbacks {
SuggestedModule, ModuleImported, FileType);
}
+ /// Hook called whenever an \#depend is seen.
+ void DependDirective(SourceLocation HashLoc, const Token &DependTok,
+ StringRef Pattern, bool IsAngled,
+ const PatternFilter &Filter,
+ OptionalFileEntryRef CurrentFile) override {
+ First->DependDirective(HashLoc, DependTok, Pattern, IsAngled, Filter,
+ CurrentFile);
+ Second->DependDirective(HashLoc, DependTok, Pattern, IsAngled, Filter,
+ CurrentFile);
+ }
+
void EnteredSubmodule(Module *M, SourceLocation ImportLoc,
bool ForPragma) override {
First->EnteredSubmodule(M, ImportLoc, ForPragma);
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index 8830294ea1658..9592f5b4a195f 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -17,6 +17,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/InputDependencyCollection.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Module.h"
@@ -343,6 +344,10 @@ class Preprocessor {
/// The kind of translation unit we are processing.
const TranslationUnitKind TUKind;
+ /// The #depend dependency patterns seen in this translation unit
+ std::shared_ptr<InputDependencyCollection> InputDependencyPatterns =
+ std::make_shared<InputDependencyCollection>();
+
/// Returns a pointer into the given file's buffer that's guaranteed
/// to be between tokens. The returned pointer is always before \p Start.
/// The maximum distance betweenthe returned pointer and \p Start is
@@ -1808,6 +1813,10 @@ class Preprocessor {
/// Lex a token, forming a header-name token if possible.
bool LexHeaderName(Token &Result, bool AllowMacroExpansion = true);
+ /// Lex a token, forming a header-name token if possible.
+ bool LexHeaderNameWithExport(Token &Result, bool *MaybeHasExport,
+ bool AllowMacroExpansion = true);
+
/// Lex the parameters for an #embed directive, returns nullopt on error.
std::optional<LexEmbedParametersResult> LexEmbedParameters(Token &Current,
bool ForHasEmbed);
@@ -2888,6 +2897,8 @@ class Preprocessor {
const FileEntry *LookupFromFile, StringRef &LookupFilename,
SmallVectorImpl<char> &RelativePath, SmallVectorImpl<char> &SearchPath,
ModuleMap::KnownHeader &SuggestedModule, bool isAngled);
+ // Input dependency caching
+ void HandleDependDirective(SourceLocation HashLoc, Token &Tok);
// Binary data inclusion
void HandleEmbedDirective(SourceLocation HashLoc, Token &Tok);
void HandleEmbedDirectiveImpl(SourceLocation HashLoc,
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index f9bf3e4de0a5e..2e8b29d3ca842 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -3053,6 +3053,7 @@ class Sema final : public SemaBase {
bool CheckInvalidBuiltinCountedByRef(const Expr *E,
BuiltinCountedByRefKind K);
bool BuiltinCountedByRef(CallExpr *TheCall);
+ bool BuiltinStdEmbed(CallExpr *TheCall);
// Matrix builtin handling.
ExprResult BuiltinMatrixTranspose(CallExpr *TheCall, ExprResult CallResult);
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index a0894318dbd53..b469e3fc17f83 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -903,6 +903,20 @@ ASTContext::ASTContext(LangOptions &LOpts, SourceManager &SM,
addTranslationUnitDecl();
}
+void ASTContext::setCurrentPreprocessorOptions(
+ const PreprocessorOptions &NewOpts) {
+ PPOpts = &NewOpts;
+}
+
+void ASTContext::setCurrentPreprocessorOptions(
+ PreprocessorOptions const *NewOpts) {
+ PPOpts = NewOpts;
+}
+
+PreprocessorOptions const *ASTContext::getCurrentPreprocessorOptions() const {
+ return PPOpts;
+}
+
void ASTContext::cleanup() {
// Release the DenseMaps associated with DeclContext objects.
// FIXME: Is this the ideal solution?
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 1a4c962801077..2995e8309360c 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -53,13 +53,18 @@
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/DiagnosticSema.h"
+#include "clang/Basic/FileManager.h"
+#include "clang/Basic/ResourceSearch.h"
+#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/ADT/APFixedPoint.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/SipHash.h"
@@ -3546,13 +3551,17 @@ static APSInt extractStringLiteralCharacter(EvalInfo &Info, const Expr *Lit,
if (auto PE = dyn_cast<PredefinedExpr>(Lit))
Lit = PE->getFunctionName();
const StringLiteral *S = cast<StringLiteral>(Lit);
+ const StringLiteralKind SLK = S->getKind();
const ConstantArrayType *CAT =
Info.Ctx.getAsConstantArrayType(S->getType());
assert(CAT && "string literal isn't an array");
QualType CharType = CAT->getElementType();
- assert(CharType->isIntegerType() && "unexpected character type");
+ assert(((SLK == StringLiteralKind::Binary &&
+ CharType->isIntegralOrEnumerationType()) ||
+ (SLK != StringLiteralKind::Binary && CharType->isIntegerType())) &&
+ "unexpected character type");
APSInt Value(Info.Ctx.getTypeSize(CharType),
- CharType->isUnsignedIntegerType());
+ CharType->isUnsignedIntegerOrEnumerationType());
if (Index < S->getLength())
Value = S->getCodeUnit(Index);
return Value;
@@ -10692,7 +10701,320 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
return false;
}
}
+ case Builtin::BI__builtin_std_embed: {
+ constexpr uint64_t FileNotFound = 0;
+ constexpr uint64_t FileFound = 1;
+ constexpr uint64_t FileFoundButNotDependedOn = 2;
+ constexpr uint64_t FileFoundAndEmpty = 3;
+
+ const Expr *LocusArg = E->getArg(0);
+ const Expr *StatusOutArg = E->getArg(1);
+ const Expr *SizeOutArg = E->getArg(2);
+ const Expr *PtrOutArg = E->getArg(3);
+ const Expr *ResourceNameSizeArg = E->getArg(4);
+ const Expr *ResourceNamePtrArg = E->getArg(5);
+ const Expr *OffsetArg = E->getArg(6);
+ const Expr *LimitArg = E->getNumArgs() == 8 ? E->getArg(7) : nullptr;
+
+ QualType PtrOutTy = PtrOutArg->getType();
+ QualType ArrElementTy = PtrOutTy->getPointeeType();
+
+ LValue ResourceNamePtrLVal;
+ if (!EvaluatePointer(ResourceNamePtrArg, ResourceNamePtrLVal, Info)) {
+ return Error(ResourceNamePtrArg);
+ }
+
+ APSInt ResourceNameSizeVal;
+ if (!EvaluateInteger(ResourceNameSizeArg, ResourceNameSizeVal, Info)) {
+ return Error(ResourceNameSizeArg);
+ }
+ if (ResourceNameSizeVal.getBitWidth() > 64) {
+ Info.FFDiag(ResourceNameSizeArg->getBeginLoc(), diag::err_ice_too_large)
+ << OffsetArg << 64 << 1;
+ return false;
+ }
+ APValue ResourceNamePtrVal;
+ ResourceNamePtrLVal.moveInto(ResourceNamePtrVal);
+ uint64_t ResourceNameSize = ResourceNameSizeVal.getZExtValue();
+
+ std::string ResourceName;
+ const QualType SizeTy = Info.Ctx.getSizeType();
+ const QualType WCharTy = Info.Ctx.getWideCharType();
+ const size_t SizeTySize = Info.Ctx.getTypeSize(SizeTy);
+ const size_t WCharTySize = Info.Ctx.getTypeSize(WCharTy);
+ const size_t IntTySize = Info.Ctx.getTypeSize(Info.Ctx.IntTy);
+ const QualType ResourceNameCharTy(
+ ResourceNamePtrArg->getType()->getPointeeOrArrayElementType(), 0);
+ if (ResourceNameCharTy->isChar8Type() || ResourceNameCharTy->isCharType() ||
+ (ResourceNameCharTy->isWideCharType() && WCharTySize == 8)) {
+ // Assume the ResourceName is directly usable as an 8-bit transmuation
+ for (size_t Index = 0; Index < ResourceNameSize; ++Index) {
+ APValue Char;
+ if (!handleLValueToRValueConversion(Info, ResourceNamePtrArg,
+ ResourceNameCharTy,
+ ResourceNamePtrLVal, Char)) {
+ return Error(ResourceNamePtrArg);
+ }
+ ResourceName.push_back(static_cast<char>(
+ static_cast<unsigned char>(Char.getInt().getExtValue())));
+
+ if (!HandleLValueArrayAdjustment(Info, ResourceNamePtrArg,
+ ResourceNamePtrLVal,
+ ResourceNameCharTy, 1)) {
+ return Error(ResourceNamePtrArg);
+ }
+ }
+ } else if (ResourceNameCharTy->isWideCharType()) {
+ // we assume either UTF-16, or UTF-32 based on the size of the string
+ // transmute accordingly
+ if (WCharTySize == 16) {
+ llvm::SmallVector<llvm::UTF16, 64> ResourceNameU16;
+ for (size_t Index = 0; Index < ResourceNameSize; ++Index) {
+ APValue Char;
+ if (!handleLValueToRValueConversion(Info, ResourceNamePtrArg,
+ ResourceNameCharTy,
+ ResourceNamePtrLVal, Char)) {
+ return Error(ResourceNamePtrArg);
+ }
+ ResourceNameU16.push_back(
+ static_cast<llvm::UTF16>(Char.getInt().getExtValue()));
+
+ if (!HandleLValueArrayAdjustment(Info, ResourceNamePtrArg,
+ ResourceNamePtrLVal,
+ ResourceNameCharTy, 1)) {
+ return Error(ResourceNamePtrArg);
+ }
+ }
+ if (!llvm::convertUTF16ToUTF8String(ResourceNameU16, ResourceName)) {
+ // error: bad name conversion
+ return Error(ResourceNamePtrArg);
+ }
+ } else if (WCharTySize == 32) {
+ llvm::SmallVector<llvm::UTF32, 64> ResourceNameU32;
+ for (size_t Index = 0; Index < ResourceNameSize; ++Index) {
+ APValue Char;
+ if (!handleLValueToRValueConversion(Info, ResourceNamePtrArg,
+ ResourceNameCharTy,
+ ResourceNamePtrLVal, Char)) {
+ return false;
+ }
+ ResourceNameU32.push_back(
+ static_cast<llvm::UTF32>(Char.getInt().getExtValue()));
+
+ if (!HandleLValueArrayAdjustment(Info, ResourceNamePtrArg,
+ ResourceNamePtrLVal,
+ ResourceNameCharTy, 1)) {
+ return false;
+ }
+ }
+ if (!llvm::convertUTF32ToUTF8String(ResourceNameU32, ResourceName)) {
+ // error: bad name conversion
+ return Error(ResourceNamePtrArg);
+ }
+ } else {
+ llvm::report_fatal_error(
+ "The filename has a wide character type that cannot be converted "
+ "to a UTF-8/multibyte string");
+ }
+ } else {
+ llvm::report_fatal_error(
+ "The filename has an unusuable or unrecognizable character type");
+ }
+
+ uint64_t DataSize = 0;
+ uint64_t DataOffset = 0;
+ std::optional<int64_t> MaybeLimit = std::nullopt;
+ auto WriteOutStatus = [&](uint64_t Status) -> bool {
+ LValue StatusOutLVal;
+ if (!EvaluateLValue(StatusOutArg, StatusOutLVal, Info)) {
+ return Error(StatusOutArg);
+ }
+ APSInt StatusVal(llvm::APInt(IntTySize, Status, true), false);
+ APValue StatusOutResult(StatusVal);
+ if (!handleAssignment(Info, StatusOutArg, StatusOutLVal,
+ StatusOutArg->getType(), StatusOutResult)) {
+ return Error(StatusOutArg);
+ }
+ return true;
+ };
+ auto WriteOutSize = [&](uint64_t Size) -> bool {
+ LValue SizeOutLVal;
+ if (!EvaluateLValue(SizeOutArg, SizeOutLVal, Info)) {
+ return Error(SizeOutArg);
+ }
+ APSInt BackingArraySizeVal(llvm::APInt(SizeTySize, Size, false), true);
+ APValue SizeOutResult(BackingArraySizeVal);
+ if (!handleAssignment(Info, SizeOutArg, SizeOutLVal,
+ SizeOutArg->getType(), SizeOutResult)) {
+ return Error(SizeOutArg);
+ }
+ return true;
+ };
+
+ APSInt LocusVal;
+ if (!EvaluateInteger(LocusArg, LocusVal, Info)) {
+ return Error(LocusArg);
+ }
+ uint64_t Locus = LocusVal.getZExtValue();
+ const bool DoQuotedSearch = (Locus & 0x01u) == 0x01u;
+ uint64_t CallStackDistance = (Locus >> 1);
+ APSInt OffsetVal;
+ if (!EvaluateInteger(OffsetArg, OffsetVal, Info)) {
+ return Error(OffsetArg);
+ }
+ if (OffsetVal.getBitWidth() > 64) {
+ Info.FFDiag(OffsetArg->getBeginLoc(), diag::err_ice_too_large)
+ << OffsetArg << 64 << 0;
+ return false;
+ }
+ DataOffset = OffsetVal.getZExtValue();
+
+ if (LimitArg) {
+ APSInt LimitVal;
+ if (!EvaluateInteger(LimitArg, LimitVal, Info)) {
+ return Error(OffsetArg);
+ }
+ if (LimitVal.getBitWidth() > 64) {
+ Info.FFDiag(LimitArg->getBeginLoc(), diag::err_ice_too_large)
+ << LimitArg << 64 << 0;
+ return false;
+ }
+ uint64_t FullLimit = LimitVal.getZExtValue();
+ if (FullLimit >
+ static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) {
+ // error: implementation limit here since we can only
+ // have a 63-bit unsigned number, not a 64-bit one
+ Info.FFDiag(LimitArg->getBeginLoc(), diag::err_ice_too_large)
+ << FullLimit << 64 << 0;
+ return false;
+ }
+ MaybeLimit = static_cast<int64_t>(FullLimit);
+ }
+
+ SourceManager &SM = Info.Ctx.getSourceManager();
+ FileManager &FM = SM.getFileManager();
+ PreprocessorOptions const *MaybePPOpts =
+ Info.Ctx.getCurrentPreprocessorOptions();
+ const std::vector<std::string> *MaybeSearchEntries = nullptr;
+ const std::vector<std::string> EmptySearchEntries(0);
+ OptionalFileEntryRef ThisFile = std::nullopt;
+ if (DoQuotedSearch) {
+ // Subtract 1 from the callstack distance, since where we are already at 1
+ if (CallStackDistance < 1) {
+ // 0 means "current", so just... take the current.
+ FileID ThisFileID =
+ SM.getFileID(Info.CurrentCall->CallRange.getBegin());
+ if (ThisFileID.isValid()) {
+ ThisFile = SM.getFileEntryRefForID(ThisFileID);
+ }
+ } else {
+ const unsigned int CallStackIndexDistance = CallStackDistance - 1;
+ const unsigned int TargetFrameIndex =
+ CallStackIndexDistance > Info.CurrentCall->Index
+ ? 1
+ : Info.CurrentCall->Index - CallStackIndexDistance;
+ auto TargetFrameAndDepth = Info.getCallFrameAndDepth(TargetFrameIndex);
+ FileID ThisFileID =
+ SM.getFileID(TargetFrameAndDepth.first->CallRange.getBegin());
+ if (ThisFileID.isValid()) {
+ ThisFile = SM.getFileEntryRefForID(ThisFileID);
+ }
+ }
+ }
+ if (MaybePPOpts) {
+ MaybeSearchEntries = &MaybePPOpts->EmbedEntries;
+ } else {
+ MaybeSearchEntries = &EmptySearchEntries;
+ }
+ OptionalFileEntryRef ResourceFile = LookupFileWithStdVec(
+ ResourceName, false, true, FM, *MaybeSearchEntries, ThisFile);
+ if (!ResourceFile) {
+ Result.setNull(Info.Ctx, PtrOutTy);
+ return WriteOutStatus(FileNotFound);
+ }
+ assert(Info.Ctx.InputDependencyPatterns &&
+ "using __builtin_std_embed requires the context to have a usable "
+ "input dependency patterns");
+ StringRef ResourceSearchName =
+ ResourceFile->getFileEntry().tryGetRealPathName();
+ if (ResourceSearchName.empty()) {
+ ResourceSearchName = ResourceName;
+ }
+ if (!Info.Ctx.InputDependencyPatterns->Check(ResourceSearchName)) {
+ Result.setNull(Info.Ctx, PtrOutTy);
+ return WriteOutStatus(FileFoundButNotDependedOn);
+ }
+ size_t FullDataSize = ResourceFile->getSize();
+ if (FullDataSize == 0 || DataOffset > FullDataSize) {
+ Result.setNull(Info.Ctx, PtrOutTy);
+ return WriteOutSize(0) && WriteOutStatus(FileFoundAndEmpty);
+ }
+ DataSize = std::max<size_t>(
+ 0, std::min<size_t>(FullDataSize - DataOffset,
+ MaybeLimit ? *MaybeLimit
+ : std::numeric_limits<size_t>::max()));
+ if (DataSize == 0) {
+ Result.setNull(Info.Ctx, PtrOutTy);
+ return WriteOutSize(0) && WriteOutStatus(FileFoundAndEmpty);
+ }
+ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> MaybeBinaryData =
+ FM.getBufferForFile(*ResourceFile, true, false, MaybeLimit, false);
+ if (auto Err = MaybeBinaryData.getError()) {
+ std::string ExtraMessage = Err.message();
+ std::string ErrorMessage = "could not open the resource";
+ if (!ExtraMessage.empty()) {
+ ErrorMessage += ", ";
+ ErrorMessage += ExtraMessage;
+ }
+ Info.FFDiag(ResourceNamePtrArg->getBeginLoc(), diag::err_cannot_open_file)
+ << ResourceName << ErrorMessage;
+ return false;
+ }
+ llvm::MemoryBuffer *BinaryData = MaybeBinaryData->get();
+ if (!BinaryData) {
+ Info.FFDiag(ResourceNamePtrArg->getBeginLoc(), diag::err_cannot_open_file)
+ << ResourceName
+ << "found the resource but unable to read the binary data";
+ return false;
+ }
+ assert(BinaryData->getBufferSize() == FullDataSize &&
+ "The binary data for some reason has a data size that is different "
+ "from the retrieved file size earlier");
+
+ // Write out size
+ LValue SizeOutLVal;
+ if (!EvaluateLValue(SizeOutArg, SizeOutLVal, Info)) {
+ return Error(SizeOutArg);
+ }
+ APSInt BackingArraySizeVal(llvm::APInt(SizeTySize, DataSize, false), true);
+ APValue SizeOutResult(BackingArraySizeVal);
+ if (!handleAssignment(Info, SizeOutArg, SizeOutLVal, SizeOutArg->getType(),
+ SizeOutResult)) {
+ return Error(SizeOutArg);
+ }
+
+ // return data literal pointer to string
+ SourceLocation BuiltinLoc = E->getBeginLoc();
+ // TODO: perhaps there may be smarter ways to load this data up;
+ // right now, this is not doing too much on the face with caching or smart
+ // deduplication in the compiler.
+ StringRef TargetData(BinaryData->getBufferStart() + DataOffset, DataSize);
+ QualType BackingArrayTy =
+ Info.Ctx.getConstantArrayType(ArrElementTy, BackingArraySizeVal,
+ nullptr, ArraySizeModifier::Normal, 0);
+ const ConstantArrayType *BackingArrayConstantArrayTy =
+ cast<ConstantArrayType>(BackingArrayTy);
+ StringLiteral *DataLiteral = StringLiteral::Create(
+ Info.Ctx, TargetData, StringLiteralKind::Binary, false, BackingArrayTy,
+ ArrayRef<SourceLocation>(&BuiltinLoc, 1));
+ if (!EvaluateLValue(DataLiteral, Result, Info)) {
+ return Error(E);
+ }
+ // inform the result we have put a string literal in there
+ Result.addArray(Info, E, BackingArrayConstantArrayTy);
+ return WriteOutStatus(FileFound);
+ }
default:
return false;
}
@@ -15365,7 +15687,8 @@ class IntExprEvaluator
bool Success(const llvm::APSInt &SI, const Expr *E, APValue &Result) {
assert(E->getType()->isIntegralOrEnumerationType() &&
"Invalid evaluation result.");
- assert(SI.isSigned() == E->getType()->isSignedIntegerOrEnumerationType() &&
+ auto Ty = E->getType();
+ assert(SI.isSigned() == Ty->isSignedIntegerOrEnumerationType() &&
"Invalid evaluation result.");
assert(SI.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
"Invalid evaluation result.");
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index adfc6ee326b5a..936e2798e65d7 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -71,6 +71,7 @@ add_clang_library(clangBasic
FileManager.cpp
FileSystemStatCache.cpp
IdentifierTable.cpp
+ InputDependencyCollection.cpp
LangOptions.cpp
LangStandards.cpp
MakeSupport.cpp
@@ -83,6 +84,7 @@ add_clang_library(clangBasic
ParsedAttrInfo.cpp
ProfileList.cpp
NoSanitizeList.cpp
+ ResourceSearch.cpp
SanitizerSpecialCaseList.cpp
Sanitizers.cpp
Sarif.cpp
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index a2e9316e4e372..5eac925fb5e6b 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -442,6 +442,7 @@ tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const {
CASE( 6, 'a', 's', assert);
CASE( 6, 'd', 'f', define);
+ CASE( 6, 'd', 'p', depend);
CASE( 6, 'i', 'n', ifndef);
CASE( 6, 'i', 'p', import);
CASE( 6, 'm', 'd', module);
diff --git a/clang/lib/Basic/InputDependencyCollection.cpp b/clang/lib/Basic/InputDependencyCollection.cpp
new file mode 100644
index 0000000000000..5f88f079b5813
--- /dev/null
+++ b/clang/lib/Basic/InputDependencyCollection.cpp
@@ -0,0 +1,191 @@
+//===--- InputDependencyCollection.h - Searching for Resource----*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// User-provided filters include/exclude profile instrumentation in certain
+// functions or files.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/InputDependencyCollection.h"
+#include "clang/Basic/FileManager.h"
+#include "llvm/Support/Path.h"
+#include <filesystem>
+
+using namespace llvm;
+
+namespace clang {
+
+PatternFilter::PatternFilter(std::string Pattern)
+ : Input(std::move(Pattern)), SearchRoot(""), PatternRoot(""), Pattern(""),
+ RootHandling(RootPatternScanType::None), Exported(false) {}
+
+bool PatternFilter::Check(StringRef Filename) const {
+ if (!PatternRoot.empty()) {
+ // if the pattern root is not empty, first check if the filename is anchored
+ // in the pattern's root exit early if it's not
+ if (!Filename.contains(PatternRoot)) {
+ return false;
+ }
+ }
+ // otherwise, commit to doing a regex search
+ if (PatternRegex.match(Filename)) {
+ // it matches, we can find it
+ return true;
+ }
+
+ return false;
+}
+
+PatternFilter InputDependencyCollection::ComputeFilter(std::string Pattern,
+ bool Exported) {
+ static constexpr const char *RecursiveReplacement = ".*";
+ static constexpr const std::size_t RecursiveReplacementSize = 2;
+ static constexpr const char *Replacement = "[^/\\]*";
+ static constexpr const std::size_t ReplacementSize = 6;
+ PatternFilter Computed(std::move(Pattern));
+ // Technically, this is a very conservative estimate, since this is only in
+ // the most harmless of cases.
+ Computed.Pattern.reserve(Computed.Input.size());
+ const std::size_t InputSize = Computed.Input.size();
+ std::optional<std::size_t> LastRootSeparator = std::nullopt;
+ std::optional<std::size_t> LastStar = std::nullopt;
+ std::optional<std::size_t> LastStarStar = std::nullopt;
+ for (std::size_t I = 0; I < InputSize; ++I) {
+ const char CharVal = Computed.Input[I];
+ switch (CharVal) {
+ case '*':
+ if (I < InputSize && Computed.Input[I + 1] == '*') {
+ // completely unrestricted: replace with `.*`
+ ++I;
+ Computed.RootHandling = static_cast<RootPatternScanType>(
+ static_cast<unsigned int>(RootPatternScanType::RecursiveDirectory) |
+ static_cast<unsigned int>(Computed.RootHandling));
+ Computed.Pattern.append(RecursiveReplacement, RecursiveReplacementSize);
+ LastStarStar = I;
+ } else {
+ // regular non-path-delimited changers: `[^\\/]*
+ Computed.RootHandling = static_cast<RootPatternScanType>(
+ static_cast<unsigned int>(
+ LastStar
+ ? (*LastStar < LastRootSeparator
+ ? RootPatternScanType::DirectoryAndRecursiveDirectory
+ : RootPatternScanType::Directory)
+ : RootPatternScanType::Directory) |
+ static_cast<unsigned int>(Computed.RootHandling));
+ Computed.Pattern.append(Replacement, ReplacementSize);
+ LastStar = I;
+ }
+ break;
+ case ')':
+ case '(':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '^':
+ case '$':
+ case '.':
+ case '+':
+ case '?':
+ case '|':
+ // cases where the character must be escaped
+ Computed.Pattern.push_back('\\');
+ Computed.Pattern.push_back(CharVal);
+ break;
+ case '/':
+ if (Computed.RootHandling == RootPatternScanType::None)
+ LastRootSeparator = I;
+ Computed.Pattern.append("[/\\]", 4);
+ break;
+ case '\\':
+ if (Computed.RootHandling == RootPatternScanType::None)
+ LastRootSeparator = I;
+ Computed.Pattern.append("[/\\]", 4);
+ break;
+ default:
+ Computed.Pattern.push_back(CharVal);
+ break;
+ }
+ }
+ Computed.Pattern.push_back('$');
+ Computed.PatternRoot.append(
+ Computed.Input.cbegin(),
+ Computed.Input.cbegin() +
+ LastRootSeparator.value_or(static_cast<std::size_t>(0)));
+ // If LastSeperator == 0 and the Input's size is Non-Zero Could be a directory
+ // OR a file we're relying on... could be a bit strange to work with!
+ // nevertheless, we'll treat it as a file, no reason to use `stat` and other
+ // temporary checks to try and determine whether or not something is a file
+ // versus a directory here.
+ Computed.PatternRegex = Regex(Computed.Pattern, Regex::NoFlags);
+ return Computed;
+}
+
+PatternFilter &
+InputDependencyCollection::Add(std::string Pattern, bool IsAngled,
+ bool Exported, FileManager &FM,
+ const std::vector<std::string> &SearchEntries,
+ OptionalFileEntryRef LookupFrom) {
+ PatternFilters.push_back(ComputeFilter(std::move(Pattern), Exported));
+ PatternFilter &Filter = PatternFilters.back();
+ if (Filter.PatternRoot.empty() ||
+ llvm::sys::path::is_absolute(Filter.PatternRoot)) {
+ // nothing else to do since it's absolute
+ // or the PatternRoot is empty, so we can't do any
+ // pre-culling.
+ return Filter;
+ }
+ // Find a plausible search root among the entries, if possible, to anchor this
+ // to a given entry
+ SmallString<256> Buffer;
+ auto TryDetermineSearchRoot = [&](StringRef SearchEntry) -> bool {
+ if (SearchEntry.contains(Filter.PatternRoot)) {
+ // the entry is contained within: approve the search entry as the search
+ // root
+ Filter.SearchRoot.assign(SearchEntry.begin(), SearchEntry.end());
+ return true;
+ }
+ Buffer.assign(SearchEntry.begin(), SearchEntry.end());
+ llvm::sys::path::append(Buffer, Filter.PatternRoot);
+ if (FM.getVirtualFileSystem().exists(Buffer)) {
+ // if the entry can prefix the pattern root and is a proper location,
+ // it is the pattern root
+ Filter.SearchRoot.assign(Buffer.begin(), Buffer.end());
+ return true;
+ }
+ return false;
+ };
+ if (!IsAngled && LookupFrom) {
+ // quote search; including the optional file entry as a root search location
+ // too
+ StringRef LookupDirName = LookupFrom->getDir().getName();
+ if (TryDetermineSearchRoot(LookupDirName)) {
+ return Filter;
+ }
+ }
+ for (StringRef SearchEntry : SearchEntries) {
+ if (TryDetermineSearchRoot(SearchEntry)) {
+ return Filter;
+ }
+ }
+ // if we're here, then we just need to make the SearchRoot identical to the
+ // Pattern's root.
+ Filter.SearchRoot = Filter.PatternRoot;
+ return Filter;
+}
+
+bool InputDependencyCollection::Check(StringRef Filename) const {
+ for (const auto &Filter : PatternFilters) {
+ if (Filter.Check(Filename)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace clang
diff --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp
index 40cdc646780e3..6170fa3bebbc0 100644
--- a/clang/lib/Basic/LangOptions.cpp
+++ b/clang/lib/Basic/LangOptions.cpp
@@ -123,6 +123,7 @@ void LangOptions::setLangDefaults(LangOptions &Opts, Language Lang,
Opts.CPlusPlus20 = Std.isCPlusPlus20();
Opts.CPlusPlus23 = Std.isCPlusPlus23();
Opts.CPlusPlus26 = Std.isCPlusPlus26();
+ Opts.CPlusPlus29 = Std.isCPlusPlus29();
Opts.GNUMode = Std.isGNUMode();
Opts.GNUCVersion = 0;
Opts.HexFloats = Std.hasHexFloats();
diff --git a/clang/lib/Basic/ResourceSearch.cpp b/clang/lib/Basic/ResourceSearch.cpp
new file mode 100644
index 0000000000000..b4d4d367424d2
--- /dev/null
+++ b/clang/lib/Basic/ResourceSearch.cpp
@@ -0,0 +1,107 @@
+//===--- ResourceSearch.h - Searching for Resources -------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// User-provided filters include/exclude profile instrumentation in certain
+// functions or files.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/ResourceSearch.h"
+#include "clang/Basic/FileManager.h"
+
+namespace clang {
+
+template <typename Strings>
+OptionalFileEntryRef LookupFileWithImpl(StringRef Filename, bool isAngled,
+ bool OpenFile, FileManager &FM,
+ const Strings &SearchEntries,
+ OptionalFileEntryRef LookupFromFile) {
+ if (llvm::sys::path::is_absolute(Filename)) {
+ // lookup path or immediately fail
+ llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
+ Filename, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
+ return llvm::expectedToOptional(std::move(ShouldBeEntry));
+ }
+
+ auto SeparateComponents = [](SmallVectorImpl<char> &LookupPath,
+ StringRef StartingFrom, StringRef FileName,
+ bool RemoveInitialFileComponentFromLookupPath) {
+ llvm::sys::path::native(StartingFrom, LookupPath);
+ if (RemoveInitialFileComponentFromLookupPath)
+ llvm::sys::path::remove_filename(LookupPath);
+ if (!LookupPath.empty() &&
+ !llvm::sys::path::is_separator(LookupPath.back())) {
+ LookupPath.push_back(llvm::sys::path::get_separator().front());
+ }
+ LookupPath.append(FileName.begin(), FileName.end());
+ };
+
+ // Otherwise, it's search time!
+ SmallString<512> LookupPath;
+ // Non-angled lookup
+ if (!isAngled) {
+ // Use file-based lookup.
+ if (LookupFromFile) {
+ SmallString<1024> TmpDir;
+ TmpDir = LookupFromFile->getDir().getName();
+ llvm::sys::path::append(TmpDir, Filename);
+ if (!TmpDir.empty()) {
+ llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
+ TmpDir, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
+ if (ShouldBeEntry)
+ return llvm::expectedToOptional(std::move(ShouldBeEntry));
+ llvm::consumeError(ShouldBeEntry.takeError());
+ }
+ }
+
+ // Otherwise, do working directory lookup.
+ LookupPath.clear();
+ auto MaybeWorkingDirEntry = FM.getDirectoryRef(".");
+ if (MaybeWorkingDirEntry) {
+ DirectoryEntryRef WorkingDirEntry = *MaybeWorkingDirEntry;
+ StringRef WorkingDir = WorkingDirEntry.getName();
+ if (!WorkingDir.empty()) {
+ SeparateComponents(LookupPath, WorkingDir, Filename, false);
+ llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
+ LookupPath, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
+ if (ShouldBeEntry)
+ return llvm::expectedToOptional(std::move(ShouldBeEntry));
+ llvm::consumeError(ShouldBeEntry.takeError());
+ }
+ }
+ }
+
+ for (const auto &Entry : SearchEntries) {
+ LookupPath.clear();
+ SeparateComponents(LookupPath, Entry, Filename, false);
+ llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
+ LookupPath, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
+ if (ShouldBeEntry)
+ return llvm::expectedToOptional(std::move(ShouldBeEntry));
+ llvm::consumeError(ShouldBeEntry.takeError());
+ }
+ return std::nullopt;
+}
+
+OptionalFileEntryRef
+LookupFileWithStdVec(StringRef Filename, bool isAngled, bool OpenFile,
+ FileManager &FM,
+ const std::vector<std::string> &SearchEntries,
+ OptionalFileEntryRef LookupFromFile) {
+ return LookupFileWithImpl(Filename, isAngled, OpenFile, FM, SearchEntries,
+ LookupFromFile);
+}
+
+OptionalFileEntryRef LookupFileWith(StringRef Filename, bool isAngled,
+ bool OpenFile, FileManager &FM,
+ ArrayRef<StringRef> SearchEntries,
+ OptionalFileEntryRef LookupFromFile) {
+ return LookupFileWithImpl(Filename, isAngled, OpenFile, FM, SearchEntries,
+ LookupFromFile);
+}
+} // namespace clang
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 05ae1f348f920..450e44796cd6d 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -770,12 +770,13 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
/*IILookup=*/nullptr,
/*OwnsHeaderSearch=*/false);
- if (ToLoad >= LoadASTOnly)
+ if (ToLoad >= LoadASTOnly) {
AST->Ctx = llvm::makeIntrusiveRefCnt<ASTContext>(
*AST->LangOpts, AST->getSourceManager(), AST->PP->getIdentifierTable(),
AST->PP->getSelectorTable(), AST->PP->getBuiltinInfo(),
AST->getTranslationUnitKind());
-
+ AST->Ctx->InputDependencyPatterns = AST->PP->InputDependencyPatterns;
+ }
DisableValidationForModuleKind disableValid =
DisableValidationForModuleKind::None;
if (::getenv("LIBCLANG_DISABLE_PCH_VALIDATION"))
@@ -811,6 +812,9 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
// Initialize the ASTContext
AST->Ctx->InitBuiltinTypes(*AST->Target);
+ // Set preprocessor options
+ AST->Ctx->setCurrentPreprocessorOptions(AST->PP->getPreprocessorOpts());
+
// Adjust printing policy based on language options.
AST->Ctx->setPrintingPolicy(PrintingPolicy(*AST->LangOpts));
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 91eda7392784f..f72cf5071038c 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -557,6 +557,8 @@ void CompilerInstance::createASTContext() {
getLangOpts(), PP.getSourceManager(), PP.getIdentifierTable(),
PP.getSelectorTable(), PP.getBuiltinInfo(), PP.TUKind);
Context->InitBuiltinTypes(getTarget(), getAuxTarget());
+ Context->setCurrentPreprocessorOptions(PP.getPreprocessorOpts());
+ Context->InputDependencyPatterns = PP.InputDependencyPatterns;
setASTContext(std::move(Context));
}
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index d56e17f14e9bc..e463347c7efb7 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -12,6 +12,7 @@
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/Basic/FileManager.h"
+#include "clang/Basic/InputDependencyCollection.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/DependencyOutputOptions.h"
#include "clang/Frontend/Utils.h"
@@ -105,6 +106,100 @@ struct DepCollectorPPCallbacks : public PPCallbacks {
// Files that actually exist are handled by FileChanged.
}
+ enum IsRecursive : bool { Flat = false, Recursive = true };
+
+ static inline void DoSearch(FileManager &FM, const PatternFilter &Filter,
+ DependencyCollector &DepCollector, StringRef Dir,
+ IsRecursive Recurse) {
+ std::error_code EC;
+ for (llvm::vfs::directory_iterator
+ FileIt = FM.getVirtualFileSystem().dir_begin(Dir, EC),
+ FileEnd = {};
+ FileIt != FileEnd && !EC; FileIt.increment(EC)) {
+ const auto &File = *FileIt;
+ switch (File.type()) {
+ case llvm::sys::fs::file_type::directory_file: {
+ if (Recurse) {
+ DoSearch(FM, Filter, DepCollector, File.path(), Recurse);
+ }
+ break;
+ }
+ case llvm::sys::fs::file_type::regular_file: {
+ StringRef Filename = File.path();
+ if (Filter.Check(Filename)) {
+ DepCollector.maybeAddDependency(Filename,
+ /*FromModule*/ false,
+ /*IsSystem*/ false,
+ /*IsModuleFile*/ false,
+ /*IsDirectModuleImport*/ false,
+ /*IsMissing*/ false);
+ }
+ break;
+ }
+ default:
+ // do nothing
+ break;
+ }
+ }
+ }
+
+ void DependDirective(SourceLocation HashLoc, const Token &DependTok,
+ StringRef Pattern, bool IsAngled,
+ const PatternFilter &Filter,
+ OptionalFileEntryRef CurrentFile) override {
+ if (Pattern.empty())
+ return;
+ FileManager &FM = PP.getFileManager();
+ llvm::vfs::FileSystem &VFS = FM.getVirtualFileSystem();
+ if (Filter.SearchRoot.empty()) {
+ // nothing we can do for ourselves here, just check the file directly and
+ // leave
+ if (Filter.RootHandling == RootPatternScanType::None) {
+ // it's either a directory or a file; add the dependency as-is
+ DepCollector.maybeAddDependency(
+ Filter.Input,
+ /*FromModule*/ false,
+ /*IsSystem*/ false,
+ /*IsModuleFile*/ false,
+ /*IsDirectModuleImport*/ false,
+ /*IsMissing*/ !VFS.exists(Filter.Pattern));
+ return;
+ }
+ // if there's no search root, simply search from the current file's
+ // working directory (if it's quoted)
+ if (!IsAngled && CurrentFile) {
+ StringRef CurrentDir = CurrentFile->getDir().getName();
+ DoSearch(FM, Filter, DepCollector, CurrentDir,
+ Filter.RootHandling == RootPatternScanType::Directory
+ ? Flat
+ : Recursive);
+ }
+ return;
+ }
+ // Otherwise, it's not empty. Note that we pre-computed the roots according
+ // to the compiler driver's resource/embed directory arguments previously,
+ // so we just need to do a singular check-if-exists-and-fire here.
+ if (Filter.RootHandling == RootPatternScanType::None) {
+ // treat as a single file, do a lookup and mark it for approval.
+ if (VFS.exists(Filter.Pattern)) {
+ // If it exists, it's what the user meant.
+ DepCollector.maybeAddDependency(Filter.Pattern,
+ /*FromModule*/ false,
+ /*IsSystem*/ false,
+ /*IsModuleFile*/ false,
+ /*IsDirectModuleImport*/ false,
+ /*IsMissing*/ false);
+ }
+ } else {
+ if (VFS.exists(Filter.SearchRoot)) {
+ DoSearch(FM, Filter, DepCollector, Filter.SearchRoot,
+ Filter.RootHandling == RootPatternScanType::Directory
+ ? Flat
+ : Recursive);
+ }
+ }
+ }
+
void HasEmbed(SourceLocation, StringRef, bool,
OptionalFileEntryRef File) override {
if (!File)
@@ -168,8 +263,8 @@ struct DepCollectorASTListener : public ASTReaderListener {
/*IsDirectModuleImport*/ DirectlyImported,
/*IsMissing*/ false);
}
- bool visitInputFile(StringRef Filename, bool IsSystem,
- bool IsOverridden, bool IsExplicitModule) override {
+ bool visitInputFile(StringRef Filename, bool IsSystem, bool IsOverridden,
+ bool IsExplicitModule) override {
if (IsOverridden || IsExplicitModule)
return true;
@@ -228,7 +323,7 @@ bool DependencyCollector::sawDependency(StringRef Filename, bool FromModule,
(needSystemDependencies() || !IsSystem);
}
-DependencyCollector::~DependencyCollector() { }
+DependencyCollector::~DependencyCollector() {}
void DependencyCollector::attachToPreprocessor(Preprocessor &PP) {
PP.addPPCallbacks(std::make_unique<DepCollectorPPCallbacks>(*this, PP));
PP.getHeaderSearchInfo().getModuleMap().addModuleMapCallbacks(
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 6e90f20572f1f..cddcbb9af1079 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -19,6 +19,7 @@
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Module.h"
+#include "clang/Basic/ResourceSearch.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
@@ -1193,72 +1194,10 @@ OptionalFileEntryRef Preprocessor::LookupEmbedFile(StringRef Filename,
bool isAngled,
bool OpenFile) {
FileManager &FM = this->getFileManager();
- if (llvm::sys::path::is_absolute(Filename)) {
- // lookup path or immediately fail
- llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
- Filename, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
- return llvm::expectedToOptional(std::move(ShouldBeEntry));
- }
-
- auto SeparateComponents = [](SmallVectorImpl<char> &LookupPath,
- StringRef StartingFrom, StringRef FileName,
- bool RemoveInitialFileComponentFromLookupPath) {
- llvm::sys::path::native(StartingFrom, LookupPath);
- if (RemoveInitialFileComponentFromLookupPath)
- llvm::sys::path::remove_filename(LookupPath);
- if (!LookupPath.empty() &&
- !llvm::sys::path::is_separator(LookupPath.back())) {
- LookupPath.push_back(llvm::sys::path::get_separator().front());
- }
- LookupPath.append(FileName.begin(), FileName.end());
- };
-
- // Otherwise, it's search time!
- SmallString<512> LookupPath;
- // Non-angled lookup
- if (!isAngled) {
- OptionalFileEntryRef LookupFromFile = getCurrentFileLexer()->getFileEntry();
- if (LookupFromFile) {
- // Use file-based lookup.
- SmallString<1024> TmpDir;
- TmpDir = LookupFromFile->getDir().getName();
- llvm::sys::path::append(TmpDir, Filename);
- if (!TmpDir.empty()) {
- llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
- TmpDir, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
- if (ShouldBeEntry)
- return llvm::expectedToOptional(std::move(ShouldBeEntry));
- llvm::consumeError(ShouldBeEntry.takeError());
- }
- }
-
- // Otherwise, do working directory lookup.
- LookupPath.clear();
- auto MaybeWorkingDirEntry = FM.getDirectoryRef(".");
- if (MaybeWorkingDirEntry) {
- DirectoryEntryRef WorkingDirEntry = *MaybeWorkingDirEntry;
- StringRef WorkingDir = WorkingDirEntry.getName();
- if (!WorkingDir.empty()) {
- SeparateComponents(LookupPath, WorkingDir, Filename, false);
- llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
- LookupPath, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
- if (ShouldBeEntry)
- return llvm::expectedToOptional(std::move(ShouldBeEntry));
- llvm::consumeError(ShouldBeEntry.takeError());
- }
- }
- }
-
- for (const auto &Entry : PPOpts.EmbedEntries) {
- LookupPath.clear();
- SeparateComponents(LookupPath, Entry, Filename, false);
- llvm::Expected<FileEntryRef> ShouldBeEntry = FM.getFileRef(
- LookupPath, OpenFile, /*CacheFailure=*/true, /*IsText=*/false);
- if (ShouldBeEntry)
- return llvm::expectedToOptional(std::move(ShouldBeEntry));
- llvm::consumeError(ShouldBeEntry.takeError());
- }
- return std::nullopt;
+ OptionalFileEntryRef LookupFromFileHere =
+ getCurrentFileLexer()->getFileEntry();
+ return LookupFileWithStdVec(Filename, isAngled, OpenFile, FM,
+ PPOpts.EmbedEntries, LookupFromFileHere);
}
//===----------------------------------------------------------------------===//
@@ -1359,6 +1298,7 @@ void Preprocessor::HandleDirective(Token &Result) {
case tok::pp___include_macros:
case tok::pp_pragma:
case tok::pp_embed:
+ case tok::pp_depend:
case tok::pp_module:
case tok::pp___preprocessed_module:
case tok::pp___preprocessed_import:
@@ -1495,6 +1435,8 @@ void Preprocessor::HandleDirective(Token &Result) {
return HandleIdentSCCSDirective(Result);
case tok::pp_embed:
return HandleEmbedDirective(Introducer.getLocation(), Result);
+ case tok::pp_depend:
+ return HandleDependDirective(Introducer.getLocation(), Result);
case tok::pp_assert:
//isExtension = true; // FIXME: implement #assert
break;
@@ -4197,6 +4139,56 @@ void Preprocessor::HandleEmbedDirective(SourceLocation HashLoc,
HandleEmbedDirectiveImpl(HashLoc, *Params, BinaryContents, FilenameToGo);
}
+void Preprocessor::HandleDependDirective(SourceLocation HashLoc,
+ Token &DependTok) {
+ // Give the usual extension/compatibility warnings.
+ if (!LangOpts.CPlusPlus29)
+ Diag(DependTok, diag::ext_pp_depend_directive);
+
+ // this unfortunately has no meaning but it's part of the grammar for the
+ // future so we should parse it normally
+ bool IsExported = false;
+ Token PatternTok;
+ // Parse the pattern header-name, with a potential skip for export keyword
+ if (LexHeaderNameWithExport(PatternTok, &IsExported)) {
+ return;
+ }
+
+ if (PatternTok.isNot(tok::header_name)) {
+ Diag(PatternTok.getLocation(), diag::err_pp_expects_pattern);
+ if (PatternTok.isNot(tok::eod))
+ DiscardUntilEndOfDirective();
+ return;
+ }
+
+ Token EoDTok;
+ LexNonComment(EoDTok);
+ if (!EoDTok.isNot(tok::eod) && !EoDTok.isNot(tok::eof)) {
+ Diag(PatternTok.getLocation(), diag::err_pp_expected_eol);
+ DiscardUntilEndOfDirective();
+ return;
+ }
+
+ SmallString<256> PatternBuffer;
+ StringRef Pattern = getSpelling(PatternTok, PatternBuffer);
+ bool IsAngled = GetIncludeFilenameSpelling(PatternTok.getLocation(), Pattern);
+ // Every pattern is local to where it was found, so prepend the current
+ // directory of the file if it's a non-absolute path from the perspective of
+ // this current header file
+ OptionalFileEntryRef CurrentFile = std::nullopt;
+ if (IsFileLexer()) {
+ PreprocessorLexer *ThisFileLexer = getCurrentFileLexer();
+ FileID ThisFID = ThisFileLexer->getFileID();
+ CurrentFile = SourceMgr.getFileEntryRefForID(ThisFID);
+ }
+ const PatternFilter &Filter = InputDependencyPatterns->Add(
+ Pattern.str(), IsAngled, IsExported, getFileManager(),
+ PPOpts.EmbedEntries, CurrentFile);
+ if (Callbacks)
+ Callbacks->DependDirective(HashLoc, DependTok, Pattern, IsAngled, Filter,
+ CurrentFile);
+}
+
/// HandleCXXImportDirective - Handle the C++ modules import directives
///
/// pp-import:
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index b08459632aacb..03bc7c9474c9b 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1072,9 +1072,32 @@ void Preprocessor::LexTokensUntilEOF(std::vector<Token> *Tokens) {
/// token is a '<').
/// \return \c true if we reached EOD or EOF while looking for a > token in
/// a concatenated header name and diagnosed it. \c false otherwise.
-bool Preprocessor::LexHeaderName(Token &FilenameTok, bool AllowMacroExpansion) {
+bool Preprocessor::LexHeaderName(Token &FilenameTok,
+ bool AllowMacroExpansion) {
+ return LexHeaderNameWithExport(FilenameTok, nullptr, AllowMacroExpansion);
+}
+
+/// Lex a header-name token (including one formed from header-name-tokens if
+/// \p AllowMacroExpansion is \c true).
+///
+/// \param FilenameTok Filled in with the next token. On success, this will
+/// be either a header_name token. On failure, it will be whatever other
+/// token was found instead.
+/// \param MaybeExportTok Set if there is a token preceding the filename that
+/// is the keyword "export". Used for #depend export[opt] ...
+/// clauses.
+/// \param AllowMacroExpansion If \c true, allow the header name to be formed
+/// by macro expansion (concatenating tokens as necessary if the first
+/// token is a '<').
+/// \return \c true if we reached EOD or EOF while looking for a > token in
+/// a concatenated header name and diagnosed it. \c false otherwise.
+bool Preprocessor::LexHeaderNameWithExport(Token &FilenameTok,
+ bool *MaybeExportTok,
+ bool AllowMacroExpansion) {
// Lex using header-name tokenization rules if tokens are being lexed from
// a file. Just grab a token normally if we're in a macro expansion.
+ bool SeenExport = false;
+header_name_start:
if (CurPPLexer) {
// Avoid nested header-name lexing when macro expansion recurses
// __has_include(__has_include))
@@ -1086,6 +1109,17 @@ bool Preprocessor::LexHeaderName(Token &FilenameTok, bool AllowMacroExpansion) {
Lex(FilenameTok);
}
+ if (!SeenExport && MaybeExportTok != nullptr) {
+ if (FilenameTok.is(tok::kw_export)) {
+ *MaybeExportTok = true;
+ SeenExport = true;
+ goto header_name_start;
+ }
+ else {
+ *MaybeExportTok = false;
+ }
+ }
+
// This could be a <foo/bar.h> file coming from a macro expansion. In this
// case, glue the tokens together into an angle_string_literal token.
SmallString<128> FilenameBuffer;
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index eb957df6f1e97..73dee5d145f6c 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3941,6 +3941,13 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
if (BuiltinCountedByRef(TheCall))
return ExprError();
break;
+ case Builtin::BI__builtin_std_embed:
+ // while we do not have Custom Typechecking,
+ // we have a `...` signature, so we do need to
+ // at least gently inspect some of the arguments
+ if (BuiltinStdEmbed(TheCall))
+ return ExprError();
+ break;
}
if (getLangOpts().HLSL && HLSL().CheckBuiltinFunctionCall(BuiltinID, TheCall))
@@ -6857,6 +6864,145 @@ bool Sema::BuiltinCountedByRef(CallExpr *TheCall) {
return false;
}
+bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
+ const bool HasProperArgCount = !checkArgCountAtLeast(TheCall, 7);
+ const bool HasExtraLimitArg =
+ !checkArgCountAtMost(TheCall, 8) && TheCall->getNumArgs() == 8;
+ if (!HasProperArgCount && !HasExtraLimitArg)
+ return true;
+
+ const Expr *Locus = TheCall->getArg(0);
+ const Expr *StatusRef = TheCall->getArg(1);
+ const Expr *SizeRef = TheCall->getArg(2);
+ const unsigned int PtrRefIndex = 3;
+ const Expr *PtrRef = TheCall->getArg(PtrRefIndex);
+ const unsigned int ResourceNameSizeIndex = 4;
+ const Expr *ResourceNameSize = TheCall->getArg(ResourceNameSizeIndex);
+ const unsigned int ResourceNamePtrIndex = 5;
+ const Expr *ResourceNamePtr = TheCall->getArg(ResourceNamePtrIndex);
+ const unsigned int OffsetIndex = 6;
+ const Expr *Offset = TheCall->getArg(OffsetIndex);
+ const unsigned int LimitIndex = 7;
+ const Expr *Limit = HasExtraLimitArg ? TheCall->getArg(LimitIndex) : nullptr;
+ const uint64_t CharSize = Context.getCharWidth();
+
+ // Locus argument type
+ QualType LocusTy = Locus->getType();
+ if (!LocusTy->isIntegralOrUnscopedEnumerationType()) {
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << Locus
+ << "an integral type with a non-negative value"
+ << Locus->getSourceRange();
+ return true;
+ }
+
+ // Status argument type
+ QualType StatusRefTy = StatusRef->getType();
+ if ((!StatusRefTy->isIntegralOrUnscopedEnumerationType()) ||
+ StatusRefTy.isConstant(Context) || !StatusRef->isLValue()) {
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << StatusRef << "'int&'" << StatusRef->getSourceRange();
+ return true;
+ }
+
+ // Size argument type
+ QualType SizeRefTy = SizeRef->getType();
+ if ((!SizeRefTy->isIntegralOrUnscopedEnumerationType()) ||
+ SizeRefTy.isConstant(Context) || !SizeRef->isLValue()) {
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << SizeRef << "'size_t&'" << SizeRef->getSourceRange();
+ return true;
+ }
+
+ // value pointer, has to be non-constant (but pointer to `const`).
+ // tells us what the type for the builtin return is as well.
+ QualType PtrRefTy = PtrRef->getType();
+ if (!PtrRefTy->isPointerType() || PtrRefTy.isConstant(Context)) {
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << PtrRefTy
+ << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
+ << PtrRef->getSourceRange();
+ return true;
+ }
+ QualType ArrElementTy = PtrRefTy->getPointeeType();
+ if (!ArrElementTy.isConstant(Context) ||
+ !(Context.getTypeSize(ArrElementTy) == CharSize &&
+ Context.getTypeAlign(ArrElementTy) == CharSize &&
+ ArrElementTy->isIntegralOrEnumerationType())) {
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << PtrRefTy
+ << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
+ << PtrRef->getSourceRange();
+ return true;
+ }
+
+ // Next argument is size of the string
+ const QualType SizeType = Context.getSizeType();
+ QualType ResourceNameSizeTy = ResourceNameSize->getType();
+ if (!ResourceNameSizeTy->isIntegralOrEnumerationType()) {
+ Diag(TheCall->getBeginLoc(),
+ diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNameSizeTy
+ << "an integral type with a non-negative value"
+ << ResourceNameSize->getSourceRange();
+ return true;
+ }
+
+ // Pointer to an appropriate string type
+ // (char, wchar_t, or char8_t)
+ QualType ResourceNamePtrTy = ResourceNamePtr->getType();
+ if (!ResourceNamePtrTy->isPointerType()) {
+ Diag(ResourceNamePtr->getBeginLoc(),
+ diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNamePtrTy
+ << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
+ << ResourceNamePtr->getSourceRange();
+ return true;
+ }
+ QualType ResourceNameCharTy(ResourceNamePtrTy->getPointeeOrArrayElementType(),
+ 0);
+ if (!ResourceNameCharTy->isCharType() && !ResourceNameCharTy->isChar8Type() &&
+ !ResourceNameCharTy->isWideCharType()) {
+ Diag(ResourceNamePtr->getBeginLoc(),
+ diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNamePtrTy
+ << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
+ << ResourceNamePtr->getSourceRange();
+ return true;
+ }
+
+ // Check offset is an integer-convertible argument
+ QualType OffsetTy = Offset->getType();
+ if (!OffsetTy->isIntegralOrEnumerationType()) {
+ Diag(TheCall->getBeginLoc(),
+ diag::err_typecheck_converted_constant_expression)
+ << OffsetTy
+ << "a non-negative integer of integral type"
+ << Offset->getSourceRange();
+ return true;
+ }
+
+ if (HasExtraLimitArg) {
+ // If present, final argument is offset
+ QualType LimitTy = Limit->getType();
+ if (!LimitTy->isIntegralOrEnumerationType()) {
+ Diag(TheCall->getBeginLoc(),
+ diag::err_typecheck_converted_constant_expression)
+ << LimitTy
+ << "a non-negative integer of integral type"
+ << Limit->getSourceRange();
+ return true;
+ }
+ }
+
+ // return the same type as was put in; we don't actually do anything with
+ // the pointer-reference type other than to use it for
+ // proper typesetting.
+ TheCall->setType(PtrRefTy);
+
+ return false;
+}
+
/// The result of __builtin_counted_by_ref cannot be assigned to a variable.
/// It allows leaking and modification of bounds safety information.
bool Sema::CheckInvalidBuiltinCountedByRef(const Expr *E,
diff --git a/clang/test/Driver/unknown-std.cpp b/clang/test/Driver/unknown-std.cpp
index 5c58042a0a2c7..6c8fcd441a85b 100644
--- a/clang/test/Driver/unknown-std.cpp
+++ b/clang/test/Driver/unknown-std.cpp
@@ -22,8 +22,10 @@
// CHECK-NEXT: note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard
// CHECK-NEXT: note: use 'c++23' for 'ISO C++ 2023 DIS' standard
// CHECK-NEXT: note: use 'gnu++23' for 'ISO C++ 2023 DIS with GNU extensions' standard
-// CHECK-NEXT: note: use 'c++2c' or 'c++26' for 'Working draft for C++2c' standard
-// CHECK-NEXT: note: use 'gnu++2c' or 'gnu++26' for 'Working draft for C++2c with GNU extensions' standard
+// CHECK-NEXT: note: use 'c++2c' or 'c++26' for 'Working draft for C++26' standard
+// CHECK-NEXT: note: use 'gnu++2c' or 'gnu++26' for 'Working draft for C++26 with GNU extensions' standard
+// CHECK-NEXT: note: use 'c++2d' or 'c++29' for 'Working draft for C++2d' standard
+// CHECK-NEXT: note: use 'gnu++2d' or 'gnu++29' for 'Working draft for C++2d with GNU extensions' standard
// Make sure that no other output is present.
// CHECK-NOT: {{^.+$}}
diff --git a/clang/test/Preprocessor/Inputs/media/nested/inside.txt b/clang/test/Preprocessor/Inputs/media/nested/inside.txt
new file mode 100644
index 0000000000000..3293407bc9c9f
--- /dev/null
+++ b/clang/test/Preprocessor/Inputs/media/nested/inside.txt
@@ -0,0 +1 @@
+:3
\ No newline at end of file
diff --git a/clang/test/Preprocessor/depend-dependencies.cpp b/clang/test/Preprocessor/depend-dependencies.cpp
new file mode 100644
index 0000000000000..5b418623cfc86
--- /dev/null
+++ b/clang/test/Preprocessor/depend-dependencies.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++2d -MMD -MT %s.o --embed-dir=%S/Inputs -dependency-file - | FileCheck %s
+
+#depend <media/*>
+#depend "single_byte.txt"
+// expected-no-diagnostics
+
+// CHECK: depend.cpp.o
+// CHECK-NEXT: depend.cpp
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}art.txt
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}empty
+// CHECK-NEXT: single_byte.txt
diff --git a/clang/test/Preprocessor/depend-export-dependencies.cpp b/clang/test/Preprocessor/depend-export-dependencies.cpp
new file mode 100644
index 0000000000000..9359fab5bb005
--- /dev/null
+++ b/clang/test/Preprocessor/depend-export-dependencies.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++2d -MMD -MT %s.o --embed-dir=%S/Inputs -dependency-file - | FileCheck %s
+
+// "export" has no meaing until p1130 makes headway, but this is parsed
+// and should not affect anything nonetheless
+#depend export <media/*>
+#depend export "single_byte.txt"
+// expected-no-diagnostics
+
+// CHECK: depend.cpp.o
+// CHECK-NEXT: depend.cpp
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}art.txt
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}empty
+// CHECK-NEXT: single_byte.txt
diff --git a/clang/test/Preprocessor/depend-recursive-dependencies.cpp b/clang/test/Preprocessor/depend-recursive-dependencies.cpp
new file mode 100644
index 0000000000000..297efaa6c50df
--- /dev/null
+++ b/clang/test/Preprocessor/depend-recursive-dependencies.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++2d -MMD -MT %s.o --embed-dir=%S/Inputs -dependency-file - | FileCheck %s
+
+#depend "media/**"
+#depend <jk.txt>
+// expected-no-diagnostics
+
+// CHECK: depend-recursive.cpp.o
+// CHECK-NEXT: depend-recursive.cpp
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}nested{{[/\\]}}inside.txt
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}art.txt
+// CHECK-NEXT: Inputs{{[/\\]}}media{{[/\\]}}empty
+// CHECK-NEXT: Inputs{{[/\\]}}jk.txt
diff --git a/clang/test/SemaCXX/Inputs/resources/a/b/empty b/clang/test/SemaCXX/Inputs/resources/a/b/empty
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/SemaCXX/Inputs/resources/art.bin b/clang/test/SemaCXX/Inputs/resources/art.bin
new file mode 100644
index 0000000000000..c409d0d60a8e3
--- /dev/null
+++ b/clang/test/SemaCXX/Inputs/resources/art.bin
@@ -0,0 +1 @@
+ @#=+@@ @@%%@@ R @======%@ @@%%%%%%%@ %=*%%==============*##%%%%%%%@ %=%%%*============*###%%%%%@ A @=%+=========+****##%%%%%% *==+----===+-----+#%%%%@ @==-----====--%%*---=%%%@ C +=*-#%@@%-===%%@@%%%--%%%@ #*-%%%%%*-===-%@%%%#%#**%@ @+**%%%=--**--+*%@@@@#**%% C *+=+-=--@%%%#-=****++***%@ @***+==--===---#+*******%%@ @*==**%%%#%%%%**+*******%%@ @+===+**%%#**************%%@ %========*****************%%%@ @======*********************#%%@ *========********************##%%@ +=========*******************###%%@ @===========+******************#####%@ #=============+****************#######%@ @+==============****************########%% %================+**************##########%@ @@=================*************###########%%@ @=================*************###########%%@ +==================************############%@ @@@===================+**********############%% *================+===**********###########%@@ @+================*+==+*********##########%%@@ @==============%%*+===********###########%%@ @+=============%%**+==+*******#%#%#######%@ %=============%%%#**==*******#%%%#######@ @@@ @ @@@ @=============*#%###*+*******#%%%%%#####@ @@@#-----##%%%%-----%%%%----++============#######******##%%%%%%####@ @-%%%%%%-----*%%%%%----*%%%-===#*======+#====@########*=+*###%%%%@@###@ @%=--=%%%%%-----%%%%%+----%%%#===*%====%%%%%%%#@@#########=####%@@@ @###@ @%%%%--%%%%%-----%%%%------%%%%==--%%====#%%@@@@@@@%@%#####@%####@@@@#####@ @@%%#---%%%*====@@@*+*####@@@%=--=%%%%+=+###@@@%%@@@@@@@@@@@######@@@######@ @@@@@@ @#######@@########@ @#########@@#@@##@ @########@ 🦝
\ No newline at end of file
diff --git a/clang/test/SemaCXX/consteval-builtin-std-embed-art.cpp b/clang/test/SemaCXX/consteval-builtin-std-embed-art.cpp
new file mode 100644
index 0000000000000..bd7c8610ba0fe
--- /dev/null
+++ b/clang/test/SemaCXX/consteval-builtin-std-embed-art.cpp
@@ -0,0 +1,198 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wno-c++2d-extensions -Wno-c++23-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wno-c++2d-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++26 -fsyntax-only -Wno-c++2d-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++2d -fsyntax-only --embed-dir=%S/Inputs %s
+// expected-no-diagnostics
+
+#depend "resources/*"
+
+namespace std {
+ enum class byte : unsigned char {};
+ typedef decltype(sizeof(0)) size_t;
+}
+
+// 79 x 40
+constexpr const unsigned char v_correct[] =
+// clang-format off
+u8" @#=+@@ @@%%@@ "
+u8" R @======%@ @@%%%%%%%@ "
+u8" %=*%%==============*##%%%%%%%@ "
+u8" %=%%%*============*###%%%%%@ "
+u8" A @=%+=========+****##%%%%%% "
+u8" *==+----===+-----+#%%%%@ "
+u8" @==-----====--%%*---=%%%@ "
+u8" C +=*-#%@@%-===%%@@%%%--%%%@ "
+u8" #*-%%%%%*-===-%@%%%#%#**%@ "
+u8" @+**%%%=--**--+*%@@@@#**%% "
+u8" C *+=+-=--@%%%#-=****++***%@ "
+u8" @***+==--===---#+*******%%@ "
+u8" @*==**%%%#%%%%**+*******%%@ "
+u8" @+===+**%%#**************%%@ "
+u8" %========*****************%%%@ "
+u8" @======*********************#%%@ "
+u8" *========********************##%%@ "
+u8" +=========*******************###%%@ "
+u8" @===========+******************#####%@ "
+u8" #=============+****************#######%@ "
+u8" @+==============****************########%% "
+u8" %================+**************##########%@ "
+u8" @@=================*************###########%%@ "
+u8" @=================*************###########%%@ "
+u8" +==================************############%@ "
+u8" @@@===================+**********############%% "
+u8" *================+===**********###########%@@ "
+u8" @+================*+==+*********##########%%@@ "
+u8" @==============%%*+===********###########%%@ "
+u8" @+=============%%**+==+*******#%#%#######%@ "
+u8" %=============%%%#**==*******#%%%#######@ "
+u8" @@@ @ @@@ @=============*#%###*+*******#%%%%%#####@ "
+u8" @@@#-----##%%%%-----%%%%----++============#######******##%%%%%%####@ "
+u8" @-%%%%%%-----*%%%%%----*%%%-===#*======+#====@########*=+*###%%%%@@###@ "
+u8" @%=--=%%%%%-----%%%%%+----%%%#===*%====%%%%%%%#@@#########=####%@@@ @###@ "
+u8"@%%%%--%%%%%-----%%%%------%%%%==--%%====#%%@@@@@@@%@%#####@%####@@@@#####@ "
+u8"@@%%#---%%%*====@@@*+*####@@@%=--=%%%%+=+###@@@%%@@@@@@@@@@@######@@@######@ "
+u8" @@@@@@ @#######@@########@"
+u8" @#########@@#@@##@ "
+u8" @########@ \xF0\x9F\xA6\x9D";
+// clang-format on
+constexpr const std::size_t v_correct_size = sizeof(v_correct) - 1;
+constexpr const unsigned char* v_correct_end = v_correct + v_correct_size;
+
+template <typename I0, typename S0, typename I1, typename S1>
+constexpr bool byte_equal (I0 first0, S0 last0, I1 first1, S1 last1) {
+ for (;first0 != last0 || first1 != last1; ++first0, ++first1) {
+ if ((unsigned char)*first0 != (unsigned char)*first1) {
+ return false;
+ }
+ }
+ return first0 == last0 && first1 == last1;
+}
+
+inline constexpr std::size_t size_max = (std::size_t)0xFFFFFFFFFFFFFFFFull;
+inline constexpr std::size_t sentinel_size = 44203zu;
+template <typename T>
+inline constexpr T sentinel_object = {};
+template <typename T>
+inline constexpr const T* sentinel_address = &sentinel_object<T>;
+
+template <typename T>
+struct inspect {
+ const T* ptr = sentinel_address<T>;
+ std::size_t size = sentinel_size;
+ int status = -1;
+};
+
+enum : int {
+ not_found,
+ found,
+ no_depend,
+ found_empty
+};
+
+template <typename T, typename C, std::size_t N>
+consteval inspect<T> non_local_lookup_core (const C (&name)[N],
+ std::size_t offset = 0,
+ std::size_t limit = size_max) {
+ inspect<T> result;
+ if (limit == size_max)
+ result.ptr = __builtin_std_embed(0b000, result.status, result.size,
+ result.ptr, N-1, name, offset);
+ else
+ result.ptr = __builtin_std_embed(0b000, result.status, result.size,
+ result.ptr, N-1, name, offset, limit);
+ return result;
+}
+
+consteval bool art () {
+ constexpr auto v0 = non_local_lookup_core<unsigned char>("resources/art.bin");
+ static_assert(v0.status == found);
+ static_assert(byte_equal(v0.ptr, v0.ptr + v0.size, &v_correct[0], v_correct_end));
+ static_assert(v0.size == v_correct_size);
+ constexpr auto v1 = non_local_lookup_core<unsigned char>(L"resources/art.bin");
+ static_assert(v1.status == found);
+ static_assert(byte_equal(v1.ptr, v1.ptr + v1.size, &v_correct[0], v_correct_end));
+ static_assert(v1.size == v_correct_size);
+ constexpr auto v2 = non_local_lookup_core<unsigned char>(u8"resources/art.bin");
+ static_assert(v2.status == found);
+ static_assert(byte_equal(v2.ptr, v2.ptr + v2.size, &v_correct[0], v_correct_end));
+ static_assert(v2.size == v_correct_size);
+
+ constexpr auto v3 = non_local_lookup_core<char>("resources/art.bin");
+ static_assert(v3.status == found);
+ static_assert(byte_equal(v3.ptr, v3.ptr + v3.size, &v_correct[0], v_correct_end));
+ static_assert(v3.size == v_correct_size);
+ constexpr auto v4 = non_local_lookup_core<char>(L"resources/art.bin");
+ static_assert(v4.status == found);
+ static_assert(byte_equal(v4.ptr, v4.ptr + v4.size, &v_correct[0], v_correct_end));
+ static_assert(v4.size == v_correct_size);
+ constexpr auto v5 = non_local_lookup_core<char>(u8"resources/art.bin");
+ static_assert(v5.status == found);
+ static_assert(byte_equal(v5.ptr, v5.ptr + v5.size, &v_correct[0], v_correct_end));
+ static_assert(v5.size == v_correct_size);
+
+ constexpr auto v6 = non_local_lookup_core<std::byte>("resources/art.bin");
+ static_assert(v6.status == found);
+ static_assert(byte_equal(v6.ptr, v6.ptr + v6.size, &v_correct[0], v_correct_end));
+ static_assert(v6.size == v_correct_size);
+ constexpr auto v7 = non_local_lookup_core<std::byte>(L"resources/art.bin");
+ static_assert(v7.status == found);
+ static_assert(byte_equal(v7.ptr, v7.ptr + v7.size, &v_correct[0], v_correct_end));
+ static_assert(v7.size == v_correct_size);
+ constexpr auto v8 = non_local_lookup_core<std::byte>(u8"resources/art.bin");
+ static_assert(v8.status == found);
+ static_assert(byte_equal(v8.ptr, v8.ptr + v8.size, &v_correct[0], v_correct_end));
+ static_assert(v8.size == v_correct_size);
+
+ return true;
+}
+
+consteval bool cannot_depend_on () {
+ // test that #depend "resources/*" pattern deos not allow something
+ // that is more "deeply" nested
+ constexpr auto v0 = non_local_lookup_core<unsigned char>("resources/a/b/empty");
+ static_assert(v0.status == no_depend);
+ static_assert(v0.ptr == nullptr);
+ static_assert(v0.size == sentinel_size);
+
+ return true;
+}
+
+consteval bool offset () {
+ constexpr std::size_t R_offset = 100;
+ constexpr std::size_t A_offset = 237;
+ constexpr auto v0 = non_local_lookup_core<unsigned char>("resources/art.bin", R_offset);
+ static_assert(v0.status == found);
+ static_assert(v0.ptr[0] == (unsigned char)'R');
+ static_assert(v0.ptr[A_offset] == (unsigned char)'A');
+ static_assert(v0.size == v_correct_size - R_offset);
+
+ constexpr auto v1 = non_local_lookup_core<unsigned char>("resources/art.bin", size_max);
+ static_assert(v1.status == found_empty);
+ static_assert(v1.ptr == nullptr);
+ static_assert(v1.size == 0);
+
+ return true;
+}
+
+consteval bool limit () {
+ constexpr std::size_t line_offset = 553;
+ constexpr std::size_t line_limit = 79;
+ constexpr std::size_t C_offset = 21;
+ constexpr auto v0 = non_local_lookup_core<unsigned char>("resources/art.bin", line_offset, line_limit);
+ static_assert(v0.status == found);
+ static_assert(v0.ptr[C_offset] == (unsigned char)'C');
+ static_assert(v0.size == line_limit);
+ static_assert(byte_equal(v0.ptr, v0.ptr + v0.size, v_correct + line_offset, v_correct + line_offset + line_limit));
+
+ constexpr auto v1 = non_local_lookup_core<unsigned char>("resources/art.bin", 0, 0);
+ static_assert(v1.status == found_empty);
+ static_assert(v1.ptr == nullptr);
+ static_assert(v1.size == 0);
+
+ return true;
+}
+
+static_assert(art());
+static_assert(cannot_depend_on());
+static_assert(offset());
+static_assert(limit());
diff --git a/clang/test/SemaCXX/consteval-builtin-std-embed-errors.cpp b/clang/test/SemaCXX/consteval-builtin-std-embed-errors.cpp
new file mode 100644
index 0000000000000..9fc291aa1f22b
--- /dev/null
+++ b/clang/test/SemaCXX/consteval-builtin-std-embed-errors.cpp
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -std=c++2d -fsyntax-only -embed-dir=%S/Inputs %s
+
+namespace std {
+ enum byte : unsigned char {};
+ typedef decltype(sizeof(0)) size_t;
+}
+
+consteval void f () {
+
+ unsigned int locus = 0;
+ int status = 0;
+ std::size_t size = 0;
+ const char* ptrc = 0;
+ const unsigned char* ptruc = 0;
+ const std::byte* ptrb = 0;
+ std::size_t offset = 0;
+ std::size_t limit = 0;
+ struct illegal_t {} illegal = {};
+
+ (void)__builtin_std_embed(locus, status, size, ptrc, 0, ptrc, offset, limit, illegal);
+ // error at -1 {{ too many arguments to function call, expected at most 8, have 9 }}
+ (void)__builtin_std_embed(locus, status, size);
+ // error at -1 {{ too few arguments to function call, expected 7, have 3 }}
+ (void)__builtin_std_embed(locus, status, size, ptrc, 0, ptrc);
+ // error at -1 {{ too few arguments to function call, expected 7, have 6 }}
+ (void)__builtin_std_embed(illegal, status, size, ptrc, 0, ptrc, offset, limit);
+ // error at -1 {{ no viable conversion from 'struct illegal_t' to 'unsigned int' }}
+ (void)__builtin_std_embed(locus, illegal, size, ptrc, 0, ptrc, offset, limit);
+ // error at -1 {{ non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'struct illegal_t' }}
+ (void)__builtin_std_embed(locus, status, illegal, ptrc, 0, ptrc, offset, limit);
+ // error at -1 {{ non-const lvalue reference to type '__size_t' (aka 'unsigned long') cannot bind to a value of unrelated type 'struct illegal_t' }}
+ (void)__builtin_std_embed(locus, status, size, illegal, 0, ptrc, offset, limit);
+ // error at -1 {{ invalid argument to '__builtin_std_embed': 'struct illegal_t' should be a pointer to const 'char', 'unsigned char', or 'std::byte' }}
+ (void)__builtin_std_embed(locus, status, size, ptrc, illegal, ptrc, offset, limit);
+ // error at -1 {{ invalid argument to '__builtin_std_embed': 'struct illegal_t' should be an integral type with a non-negative value }}
+ (void)__builtin_std_embed(locus, status, size, ptrc, 0, illegal, offset, limit);
+ // error at -1 {{ invalid argument to '__builtin_std_embed': 'struct illegal_t' should be a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t' }}
+ (void)__builtin_std_embed(locus, status, size, ptrc, 0, ptrc, illegal, limit);
+ // error at -1 {{ value of type 'struct illegal_t' is not implicitly convertible to a non-negative integer of integral type }}
+ (void)__builtin_std_embed(locus, status, size, ptrc, 0, ptrc, offset, illegal);
+ // error at -1 {{ value of type 'struct illegal_t' is not implicitly convertible to a non-negative integer of integral type }}
+}
diff --git a/clang/test/SemaCXX/consteval-builtin-std-embed-local_file.cpp b/clang/test/SemaCXX/consteval-builtin-std-embed-local_file.cpp
new file mode 100644
index 0000000000000..dc9cfa3932c47
--- /dev/null
+++ b/clang/test/SemaCXX/consteval-builtin-std-embed-local_file.cpp
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wno-c++2d-extensions -Wno-c++23-extensions -Wnoc23-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wno-c++2d-extensions -Wnoc23-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++26 -fsyntax-only -Wno-c++2d-extensions -Wnoc23-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++2d -fsyntax-only -Wnoc23-extensions --embed-dir=%S/Inputs %s
+// expected-no-diagnostics
+
+#depend __FILE__
+
+namespace std {
+ enum class byte : unsigned char {};
+}
+
+template <typename I0, typename S0, typename I1, typename S1>
+constexpr bool byte_equal (I0 first0, S0 last0, I1 first1, S1 last1) {
+ for (;first0 != last0 || first1 != last1; ++first0, ++first1) {
+ if ((unsigned char)*first0 != (unsigned char)*first1) {
+ return false;
+ }
+ }
+ return first0 == last0 && first1 == last1;
+}
+
+inline constexpr decltype(sizeof(0)) sentinel_size = 44203;
+template <typename T>
+inline constexpr T sentinel_object = {};
+template <typename T>
+inline constexpr const T* sentinel_address = &sentinel_object<T>;
+
+template <typename T>
+struct inspect {
+ const T* ptr = sentinel_address<T>;
+ decltype(sizeof(0)) size = sentinel_size;
+ int status = -1;
+};
+
+enum : int {
+ not_found,
+ found,
+ no_depend,
+ found_empty,
+};
+
+template <typename T, typename C, decltype(sizeof(0)) N>
+consteval inspect<T> local_lookup_core (const C (&name)[N]) {
+ inspect<T> result;
+ result.ptr = __builtin_std_embed(0b000, result.status, result.size, result.ptr, (N)-1, name, 0);
+ return result;
+}
+
+consteval bool local_file () {
+ static constexpr const unsigned char file[] = {
+#embed __FILE__
+ };
+ static constexpr const decltype(sizeof(0)) file_size = sizeof(file);
+ constexpr auto v0 = local_lookup_core<unsigned char>(__FILE__);
+ static_assert(v0.status == found);
+ static_assert(byte_equal(v0.ptr, v0.ptr + v0.size, &file[0], &file[0] + file_size));
+ static_assert(v0.size == file_size);
+
+ constexpr auto v1 = local_lookup_core<char>(__FILE__);
+ static_assert(v1.status == found);
+ static_assert(byte_equal(v1.ptr, v1.ptr + v1.size, &file[0], &file[0] + file_size));
+ static_assert(v1.size == file_size);
+
+ constexpr auto v2 = local_lookup_core<std::byte>(__FILE__);
+ static_assert(v2.status == found);
+ static_assert(byte_equal(v2.ptr, v2.ptr + v2.size, &file[0], &file[0] + file_size));
+ static_assert(v2.size == file_size);
+
+ return true;
+}
+
+static_assert(local_file());
diff --git a/clang/test/SemaCXX/consteval-builtin-std-embed.cpp b/clang/test/SemaCXX/consteval-builtin-std-embed.cpp
new file mode 100644
index 0000000000000..2c6a836ec3244
--- /dev/null
+++ b/clang/test/SemaCXX/consteval-builtin-std-embed.cpp
@@ -0,0 +1,186 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wno-c++2d-extensions -Wno-c++23-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wno-c++2d-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++26 -fsyntax-only -Wno-c++2d-extensions --embed-dir=%S/Inputs %s
+// RUN: %clang_cc1 -std=c++2d -fsyntax-only --embed-dir=%S/Inputs %s
+// expected-no-diagnostics
+
+#depend "resources/**"
+
+namespace std {
+ enum class byte : unsigned char {};
+}
+
+inline constexpr decltype(sizeof(0)) sentinel_size = 44203zu;
+template <typename T>
+inline constexpr T sentinel_object = {};
+template <typename T>
+inline constexpr const T* sentinel_address = &sentinel_object<T>;
+
+template <typename T>
+struct inspect {
+ const T* ptr = sentinel_address<T>;
+ decltype(sizeof(0)) size = sentinel_size;
+ int status = -1;
+};
+
+enum : int {
+ not_found,
+ found,
+ no_depend,
+ found_empty
+};
+
+template <typename T, typename C>
+consteval inspect<T> does_not_exist_core () {
+ static constexpr const C name[1] = { C(0) };
+ inspect<T> result = {};
+ result.ptr = __builtin_std_embed(0b000, result.status, result.size, result.ptr, (sizeof(name) / sizeof(*name))-1, &name[0], 0);
+ return result;
+}
+
+template <typename T, typename C, decltype(sizeof(0)) N>
+consteval inspect<T> non_local_lookup_core (const C (&name)[N]) {
+ inspect<T> result = {};
+ result.ptr = __builtin_std_embed(0b000, result.status, result.size, result.ptr, (N)-1, &name[0], 0);
+ return result;
+}
+
+template <typename T, typename C, decltype(sizeof(0)) N>
+consteval inspect<T> local_lookup_core (const C (&name)[N]) {
+ inspect<T> result = {};
+ result.ptr = __builtin_std_embed(0b001, result.status, result.size, result.ptr, (N)-1, &name[0], 0);
+ return result;
+}
+
+consteval bool does_not_exist () {
+ constexpr auto v0 = does_not_exist_core<unsigned char, char>();
+ static_assert(v0.status == not_found);
+ static_assert(v0.ptr == nullptr);
+ static_assert(v0.size == sentinel_size);
+ constexpr auto v1 = does_not_exist_core<char, char>();
+ static_assert(v1.status == not_found);
+ static_assert(v1.ptr == nullptr);
+ static_assert(v1.size == sentinel_size);
+ constexpr auto v2 = does_not_exist_core<std::byte, char>();
+ static_assert(v2.status == not_found);
+ static_assert(v2.ptr == nullptr);
+ static_assert(v2.size == sentinel_size);
+
+ constexpr auto v3 = does_not_exist_core<unsigned char, wchar_t>();
+ static_assert(v3.status == not_found);
+ static_assert(v3.ptr == nullptr);
+ static_assert(v3.size == sentinel_size);
+ constexpr auto v4 = does_not_exist_core<char, wchar_t>();
+ static_assert(v4.status == not_found);
+ static_assert(v4.ptr == nullptr);
+ static_assert(v4.size == sentinel_size);
+ constexpr auto v5 = does_not_exist_core<std::byte, wchar_t>();
+ static_assert(v5.status == not_found);
+ static_assert(v5.ptr == nullptr);
+ static_assert(v5.size == sentinel_size);
+
+ constexpr auto v6 = does_not_exist_core<unsigned char, char8_t>();
+ static_assert(v6.status == not_found);
+ static_assert(v6.ptr == nullptr);
+ static_assert(v6.size == sentinel_size);
+ constexpr auto v7 = does_not_exist_core<char, char8_t>();
+ static_assert(v7.status == not_found);
+ static_assert(v7.ptr == nullptr);
+ static_assert(v7.size == sentinel_size);
+ constexpr auto v8 = does_not_exist_core<std::byte, char8_t>();
+ static_assert(v8.status == not_found);
+ static_assert(v8.ptr == nullptr);
+ static_assert(v8.size == sentinel_size);
+
+ return true;
+}
+
+consteval bool not_depended_on () {
+ constexpr auto v0 = local_lookup_core<unsigned char>("consteval-builtin-std-embed.cpp");
+ static_assert(v0.status == no_depend);
+ static_assert(v0.ptr == nullptr);
+ static_assert(v0.size == sentinel_size);
+ constexpr auto v1 = local_lookup_core<unsigned char>(L"consteval-builtin-std-embed.cpp");
+ static_assert(v1.status == no_depend);
+ static_assert(v1.ptr == nullptr);
+ static_assert(v1.size == sentinel_size);
+ constexpr auto v2 = local_lookup_core<unsigned char>(u8"consteval-builtin-std-embed.cpp");
+ static_assert(v2.status == no_depend);
+ static_assert(v2.ptr == nullptr);
+ static_assert(v2.size == sentinel_size);
+
+ constexpr auto v3 = local_lookup_core<char>("consteval-builtin-std-embed.cpp");
+ static_assert(v3.status == no_depend);
+ static_assert(v3.ptr == nullptr);
+ static_assert(v3.size == sentinel_size);
+ constexpr auto v4 = local_lookup_core<char>(L"consteval-builtin-std-embed.cpp");
+ static_assert(v4.status == no_depend);
+ static_assert(v4.ptr == nullptr);
+ static_assert(v4.size == sentinel_size);
+ constexpr auto v5 = local_lookup_core<char>(u8"consteval-builtin-std-embed.cpp");
+ static_assert(v5.status == no_depend);
+ static_assert(v5.ptr == nullptr);
+ static_assert(v5.size == sentinel_size);
+
+ constexpr auto v6 = local_lookup_core<std::byte>("consteval-builtin-std-embed.cpp");
+ static_assert(v6.status == no_depend);
+ static_assert(v6.ptr == nullptr);
+ static_assert(v6.size == sentinel_size);
+ constexpr auto v7 = local_lookup_core<std::byte>(L"consteval-builtin-std-embed.cpp");
+ static_assert(v7.status == no_depend);
+ static_assert(v7.ptr == nullptr);
+ static_assert(v7.size == sentinel_size);
+ constexpr auto v8 = local_lookup_core<std::byte>(u8"consteval-builtin-std-embed.cpp");
+ static_assert(v8.status == no_depend);
+ static_assert(v8.ptr == nullptr);
+ static_assert(v8.size == sentinel_size);
+
+ return true;
+}
+
+consteval bool empty () {
+ constexpr auto v0 = non_local_lookup_core<unsigned char>("resources/a/b/empty");
+ static_assert(v0.status == found_empty);
+ static_assert(v0.ptr == nullptr);
+ static_assert(v0.size == 0);
+ constexpr auto v1 = non_local_lookup_core<unsigned char>(L"resources/a/b/empty");
+ static_assert(v1.status == found_empty);
+ static_assert(v1.ptr == nullptr);
+ static_assert(v1.size == 0);
+ constexpr auto v2 = non_local_lookup_core<unsigned char>(u8"resources/a/b/empty");
+ static_assert(v2.status == found_empty);
+ static_assert(v2.ptr == nullptr);
+ static_assert(v2.size == 0);
+
+ constexpr auto v3 = non_local_lookup_core<char>("resources/a/b/empty");
+ static_assert(v3.status == found_empty);
+ static_assert(v3.ptr == nullptr);
+ static_assert(v3.size == 0);
+ constexpr auto v4 = non_local_lookup_core<char>(L"resources/a/b/empty");
+ static_assert(v4.status == found_empty);
+ static_assert(v4.ptr == nullptr);
+ static_assert(v4.size == 0);
+ constexpr auto v5 = non_local_lookup_core<char>(u8"resources/a/b/empty");
+ static_assert(v5.status == found_empty);
+ static_assert(v5.ptr == nullptr);
+ static_assert(v5.size == 0);
+
+ constexpr auto v6 = non_local_lookup_core<std::byte>("resources/a/b/empty");
+ static_assert(v6.status == found_empty);
+ static_assert(v6.ptr == nullptr);
+ static_assert(v6.size == 0);
+ constexpr auto v7 = non_local_lookup_core<std::byte>(L"resources/a/b/empty");
+ static_assert(v7.status == found_empty);
+ static_assert(v7.ptr == nullptr);
+ static_assert(v7.size == 0);
+ constexpr auto v8 = non_local_lookup_core<std::byte>(u8"resources/a/b/empty");
+ static_assert(v8.status == found_empty);
+ static_assert(v8.ptr == nullptr);
+ static_assert(v8.size == 0);
+
+ return true;
+}
+
+static_assert(does_not_exist());
+static_assert(not_depended_on());
+static_assert(empty());
diff --git a/clang/tools/clang-import-test/clang-import-test.cpp b/clang/tools/clang-import-test/clang-import-test.cpp
index 8e83687d3e96a..2234f44c0611a 100644
--- a/clang/tools/clang-import-test/clang-import-test.cpp
+++ b/clang/tools/clang-import-test/clang-import-test.cpp
@@ -229,6 +229,8 @@ BuildASTContext(CompilerInstance &CI, SelectorTable &ST, Builtin::Context &BC) {
CI.getLangOpts(), CI.getSourceManager(),
PP.getIdentifierTable(), ST, BC, PP.TUKind);
AST->InitBuiltinTypes(CI.getTarget());
+ AST->setCurrentPreprocessorOptions(PP.getPreprocessorOpts());
+ AST->InputDependencyPatterns = PP.InputDependencyPatterns;
return AST;
}
diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp
index 9533fbc776e6e..f3b89db0be8c1 100644
--- a/clang/unittests/Lex/PPCallbacksTest.cpp
+++ b/clang/unittests/Lex/PPCallbacksTest.cpp
@@ -311,6 +311,7 @@ class PPCallbacksTest : public ::testing::Test {
ASTContext Context(OpenCLLangOpts, SourceMgr, PP.getIdentifierTable(),
PP.getSelectorTable(), PP.getBuiltinInfo(), PP.TUKind);
Context.InitBuiltinTypes(*Target);
+ Context.setCurrentPreprocessorOptions(PP.getPreprocessorOpts());
ASTConsumer Consumer;
Sema S(PP, Context, Consumer);
diff --git a/clang/www/OpenProjects.html b/clang/www/OpenProjects.html
index 3e5e84b5b2ed4..71ce7ecf416d8 100755
--- a/clang/www/OpenProjects.html
+++ b/clang/www/OpenProjects.html
@@ -112,7 +112,7 @@ <h1>Open Clang Projects</h1>
</ul>
</li>
-<li><b>Continue work on C++20, C++23, C++2c, and C23 support</b>:
+<li><b>Continue work on C++20, C++23, C++2c, C++2d, and C23 support</b>:
There are still several C++20 features to complete, and work has begun on
supporting the latest language standards. Please see the
<a href="cxx_status.html">C++ status report page</a> to find out what is
diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index 8b7290a2a60cc..10b6475dc7170 100755
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -374,6 +374,12 @@ <h2 id="cxx26">C++2c implementation status</h2>
<td><a href="https://wg21.link/P3769">P3769R1</a>(<a href="#dr">DR</a>)</td>
<td class="none" align="center">No</td>
</tr>
+ <!-- Summer 2026-->
+ <tr>
+ <td><tt>std::embed</tt> and <tt>#depend</tt></td>
+ <td><a href="https://wg21.link/P1040R10">P1040R10</a></td>
+ <td class="none" align="center">Yes</td>
+ </tr>
</table>
</details>
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 941c1c23c7d8a..f30f57f83d678 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -539,5 +539,9 @@ Status
``__cpp_lib_tuple_like`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_variant`` ``202306L``
+ ---------------------------------------------------------- -----------------
+ **C++29**
+ ----------------------------------------------------------------------------
+ ``__cpp_lib_embed`` ``202606L``
========================================================== =================
diff --git a/libcxx/docs/Status/Cxx2d.rst b/libcxx/docs/Status/Cxx2d.rst
new file mode 100644
index 0000000000000..dfc308de78132
--- /dev/null
+++ b/libcxx/docs/Status/Cxx2d.rst
@@ -0,0 +1,43 @@
+.. _cxx2d-status:
+
+================================
+libc++ C++2d Status
+================================
+
+.. include:: ../Helpers/Styles.rst
+
+.. contents::
+ :local:
+
+
+Overview
+================================
+
+In Winter 2025, the C++ standard committee adopted the first changes to the next version of the C++ standard, known here as "C++2d" (probably to be C++29).
+
+This page shows the status of libc++; the status of clang's support of the language features is `here <https://clang.llvm.org/cxx_status.html#cxx2d>`__.
+
+.. attention:: Features in unreleased drafts of the standard are subject to change.
+
+The groups that have contributed papers:
+
+- CWG - Core Language Working group
+- LWG - Library working group
+
+.. note:: "Nothing to do" means that no library changes were needed to implement this change.
+
+Paper Status
+====================================
+
+.. csv-table::
+ :file: Cxx2dPapers.csv
+ :header-rows: 1
+ :widths: auto
+
+Library Working Group Issues Status
+====================================
+
+.. csv-table::
+ :file: Cxx2dIssues.csv
+ :header-rows: 1
+ :widths: auto
diff --git a/libcxx/docs/Status/Cxx2dIssues.csv b/libcxx/docs/Status/Cxx2dIssues.csv
new file mode 100644
index 0000000000000..1145255a2c39a
--- /dev/null
+++ b/libcxx/docs/Status/Cxx2dIssues.csv
@@ -0,0 +1,2 @@
+"Issue #","Issue Name","Meeting","Status","First released version","GitHub issue","Notes"
+"","","","","","",""
diff --git a/libcxx/docs/Status/Cxx2dIssues.csvgb b/libcxx/docs/Status/Cxx2dIssues.csvgb
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/libcxx/docs/Status/Cxx2dPapers.csv b/libcxx/docs/Status/Cxx2dPapers.csv
new file mode 100644
index 0000000000000..fd38c16435f47
--- /dev/null
+++ b/libcxx/docs/Status/Cxx2dPapers.csv
@@ -0,0 +1,3 @@
+"Paper #","Paper Name","Meeting","Status","First released version","GitHub issue","Notes"
+"`P1040R10 <https://wg21.link/P1040R10>`__","``std::embed``","2026-06 (Brno)","","","`#190578 <https://github.com/llvm/llvm-project/pull/190578>`__","Experimental"
+"", "", "", "", "", "", ""
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index 38f77580d4530..10086364088fd 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -49,6 +49,7 @@ Getting Started with libc++
Status/Cxx20
Status/Cxx23
Status/Cxx2c
+ Status/Cxx2d
Status/Format
Status/Parallelism
@@ -184,6 +185,7 @@ this release is described in the pages below:
* :ref:`C++20 - In Progress <cxx20-status>`
* :ref:`C++23 - In Progress <cxx23-status>`
* :ref:`C++2c - In Progress <cxx2c-status>`
+* :ref:`C++2d - In Progress <cxx2d-status>`
* :ref:`C++ Feature Test Macro Status <feature-status>`
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 497aadfd799bf..2d4cd1194368d 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -1014,6 +1014,7 @@ set(files
cwchar
cwctype
deque
+ embed
errno.h
exception
execution
diff --git a/libcxx/include/__configuration/language.h b/libcxx/include/__configuration/language.h
index 3137ba2ea27ef..ebc1975159601 100644
--- a/libcxx/include/__configuration/language.h
+++ b/libcxx/include/__configuration/language.h
@@ -31,9 +31,11 @@
# define _LIBCPP_STD_VER 20
# elif __cplusplus <= 202302L
# define _LIBCPP_STD_VER 23
-# else
-// Expected release year of the next C++ standard
+# elif __cplusplus <= 202603L
# define _LIBCPP_STD_VER 26
+# else
+// whatever the __cplusplus macro says it should be
+# define _LIBCPP_STD_VER ((__cplusplus / 100) - 2000)
# endif
#endif // __cplusplus
// NOLINTEND(libcpp-cpp-version-check)
diff --git a/libcxx/include/embed b/libcxx/include/embed
new file mode 100644
index 0000000000000..3f08828e2e090
--- /dev/null
+++ b/libcxx/include/embed
@@ -0,0 +1,175 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EMBED
+#define _LIBCPP_EMBED
+
+/*
+ embed synopsis
+
+namespace std {
+
+ template <class T>
+consteval span<const T> embed(string_view resource_idenfier,
+ size_t offset = 0,
+ optional<size_t> limit = nullopt);
+
+ template <class T>
+consteval span<const T> embed(wstring_view resource_idenfier,
+ size_t offset = 0,
+ optional<size_t> limit = nullopt);
+
+ template <class T>
+consteval span<const T> embed(u8string_view resource_idenfier,
+ size_t offset = 0,
+ optional<size_t> limit = nullopt);
+
+ template <class T, size_t Limit>
+consteval span<const T, Limit> embed(string_view resource_idenfier,
+ size_t offset = 0);
+
+ template <class T, size_t Limit>
+consteval span<const , Limit> embed(wstring_view resource_idenfier,
+ size_t offset = 0);
+
+ template <class T, size_t Limit>
+consteval span<const T, Limit> embed(u8string_view resource_idenfier,
+ size_t offset = 0);
+
+} // namespace std
+
+*/
+
+#include <__assert>
+#include <__config>
+#include <__cstddef/byte.h>
+#include <__type_traits/is_same.h>
+#include <__verbose_abort>
+#include <optional>
+#include <span>
+#include <stdexcept>
+#include <string_view>
+#include <version>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if __has_builtin(__builtin_std_embed)
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace __embed_detail {
+enum __builtin_embed_status {
+ __file_not_found = 0,
+ __file_found = 1,
+ __file_found_no_depends = 2,
+ __file_found_empty = 3,
+};
+inline constexpr unsigned int __quoted_search_distance = 0b101;
+
+template <typename _Byte, size_t _Extent, typename _StrView>
+_LIBCPP_NODISCARD consteval _LIBCPP_HIDE_FROM_ABI span<const _Byte, _Extent>
+__embed(const _StrView& __resource_identifier, size_t __offset, [[maybe_unused]] const optional<size_t>& __limit) {
+ static_assert(is_same_v<_Byte, unsigned char> || is_same_v<_Byte, char> || is_same_v<_Byte, byte>,
+ "embed type must be unqualified 'char', 'unsigned char', or 'byte'");
+ size_t __size = 0;
+ _Byte const* __ptr = nullptr;
+ int __status = -1;
+ if constexpr (_Extent != std::dynamic_extent) {
+ __ptr = __builtin_std_embed(
+ __quoted_search_distance,
+ __status,
+ __size,
+ __ptr,
+ __resource_identifier.size(),
+ __resource_identifier.data(),
+ __offset,
+ _Extent);
+ } else {
+ if (__limit) {
+ __ptr = __builtin_std_embed(
+ __quoted_search_distance,
+ __status,
+ __size,
+ __ptr,
+ __resource_identifier.size(),
+ __resource_identifier.data(),
+ __offset,
+ *__limit);
+ } else {
+ __ptr = __builtin_std_embed(
+ __quoted_search_distance,
+ __status,
+ __size,
+ __ptr,
+ __resource_identifier.size(),
+ __resource_identifier.data(),
+ __offset);
+ }
+ }
+ if (__status == __file_not_found) {
+ _LIBCPP_VERBOSE_ABORT("file not found");
+ } else if (__status == __file_found_no_depends) {
+ _LIBCPP_VERBOSE_ABORT("file found but not appropriately '#depend <>'-ed on");
+ }
+ if constexpr (_Extent != std::dynamic_extent) {
+ if (_Extent > __size) {
+ _LIBCPP_VERBOSE_ABORT("the fixed-size span extent is larger than the resource data size");
+ }
+ __size = _Extent;
+ }
+ if (__status == __file_found_empty) {
+ return span<const _Byte, _Extent>();
+ }
+ _LIBCPP_ASSERT(__status == __file_found,
+ "status value should be `1`, indicating a "
+ "successful finding of a file with data that has been '#depend <>`-ed on");
+ return span<const _Byte, _Extent>(__ptr, __size);
+}
+} // namespace __embed_detail
+
+template <typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte>
+embed(string_view __resource_identifier, size_t __offset = 0, optional<size_t> __limit = nullopt) {
+ return __embed_detail::__embed<_Byte, dynamic_extent>(__resource_identifier, __offset, __limit);
+}
+
+template <typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte>
+embed(wstring_view __resource_identifier, size_t __offset = 0, optional<size_t> __limit = nullopt) {
+ return __embed_detail::__embed<_Byte, dynamic_extent>(__resource_identifier, __offset, __limit);
+}
+
+template <typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte>
+embed(u8string_view __resource_identifier, size_t __offset = 0, optional<size_t> __limit = nullopt) {
+ return __embed_detail::__embed<_Byte, dynamic_extent>(__resource_identifier, __offset, __limit);
+}
+
+template <size_t _Limit, typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte, _Limit> embed(string_view __resource_identifier, size_t __offset = 0) {
+ return __embed_detail::__embed<_Byte, _Limit>(__resource_identifier, __offset, nullopt);
+}
+
+template <size_t _Limit, typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte, _Limit> embed(wstring_view __resource_identifier, size_t __offset = 0) {
+ return __embed_detail::__embed<_Byte, _Limit>(__resource_identifier, __offset, nullopt);
+}
+
+template <size_t _Limit, typename _Byte = byte>
+_LIBCPP_NODISCARD consteval span<const _Byte, _Limit> embed(u8string_view __resource_identifier, size_t __offset = 0) {
+ return __embed_detail::__embed<_Byte, _Limit>(__resource_identifier, __offset, nullopt);
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // __has_builtin(__builtin_std_embed)
+
+#endif // _LIBCPP_EMBED
diff --git a/libcxx/include/version b/libcxx/include/version
index 8ff06dae7bb0a..07a7594af0193 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -102,6 +102,7 @@ __cpp_lib_default_template_type_for_algorithm_values 202403L <algorithm> <deq
<list> <ranges> <string>
<vector>
__cpp_lib_destroying_delete 201806L <new>
+__cpp_lib_embed 202606L <embed>
__cpp_lib_enable_shared_from_this 201603L <memory>
__cpp_lib_endian 201907L <bit>
__cpp_lib_erase_if 202002L <deque> <forward_list> <list>
@@ -636,6 +637,10 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_variant 202306L
#endif
+#if _LIBCPP_STD_VER >= 29
+# define __cpp_lib_embed 202606L
+#endif
+
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
// clang-format on
diff --git a/libcxx/test/std/embed/a.txt b/libcxx/test/std/embed/a.txt
new file mode 100644
index 0000000000000..78981922613b2
--- /dev/null
+++ b/libcxx/test/std/embed/a.txt
@@ -0,0 +1 @@
+a
diff --git a/libcxx/test/std/embed/embed-mandates.verify.cpp b/libcxx/test/std/embed/embed-mandates.verify.cpp
new file mode 100644
index 0000000000000..e6b9bbe97358a
--- /dev/null
+++ b/libcxx/test/std/embed/embed-mandates.verify.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// check that <embed> functions are marked [[nodiscard]]
+
+#include <embed>
+
+#depend __FILE__
+
+#include "test_macros.h"
+
+consteval void test() {
+#if TEST_STD_VER >= 23
+ // make sure to test each individual overload
+ (void)std::embed<signed char>(__FILE__);
+ // expected-error at -1 {{embed type must be unqualified 'char', 'unsigned char', or 'byte'}}
+ (void)std::embed("praise the sun!");
+ // expected-error at -1 {{file not found}}
+ (void)std::embed<signed char>("a.txt");
+ // expected-error at -1 {{file found but not appropriately '#depend <>'-ed on}}
+ (void)std::embed<1234>("a.txt");
+ // expected-error at -1 {{the fixed-size span extent is larger than the resource data size}}
+#endif
+}
+
+#undef STR_PREFIX_
+#undef STR_PREFIX
diff --git a/libcxx/test/std/embed/embed-nodiscard.verify.cpp b/libcxx/test/std/embed/embed-nodiscard.verify.cpp
new file mode 100644
index 0000000000000..9381ea53b1651
--- /dev/null
+++ b/libcxx/test/std/embed/embed-nodiscard.verify.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// check that <embed> functions are marked [[nodiscard]]
+
+#include <embed>
+
+#depend __FILE__
+
+#include "test_macros.h"
+
+#define STR_PREFIX_(a, b) a##b
+#define STR_PREFIX(a, b) STR_PREFIX_(a, b)
+
+consteval void test() {
+#if TEST_STD_VER >= 23
+ // make sure to test each individual overload
+ std::embed(__FILE__);
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::embed<1>(__FILE__);
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::embed(STR_PREFIX(L, __FILE__));
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::embed<1>(STR_PREFIX(L, __FILE__));
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+
+ std::embed(STR_PREFIX(u8, __FILE__));
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::embed<1>(STR_PREFIX(u8, __FILE__));
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+#endif
+}
+
+#undef STR_PREFIX_
+#undef STR_PREFIX
diff --git a/libcxx/test/std/embed/embed-post-conditions.pass.cpp b/libcxx/test/std/embed/embed-post-conditions.pass.cpp
new file mode 100644
index 0000000000000..32d164dc47ed5
--- /dev/null
+++ b/libcxx/test/std/embed/embed-post-conditions.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// check that <embed> functions are marked [[nodiscard]]
+
+// clang-format off
+
+#include <embed>
+
+#depend __FILE__
+#depend "a"
+#depend "empty"
+
+#include "test_macros.h"
+
+consteval void main(int, char*[]) {
+#if TEST_STD_VER >= 23
+ constexpr auto v0 = std::embed("a.txt");
+ static_assert(v0.data() != nullptr);
+ static_assert(v0.size() == 1);
+ static_assert(v0[0] == (std::byte)u8'a');
+
+ constexpr auto v1 = std::embed(__FILE__);
+ static_assert(v1.data() == nullptr);
+ static_assert(v1.size() == 0);
+
+ constexpr auto v2 = std::embed(__FILE__, 0x123456);
+ static_assert(v2.data() == nullptr);
+ static_assert(v2.size() == 0);
+
+ constexpr auto v3 = std::embed(__FILE__, 0, 0);
+ static_assert(v3.data() == nullptr);
+ static_assert(v3.size() == 0);
+
+ constexpr auto v4 = std::embed<0>(__FILE__);
+ static_assert(v4.data() == nullptr);
+ static_assert(v4.size() == 0);
+
+ constexpr auto v4 = std::embed("empty");
+ static_assert(v4.data() == nullptr);
+ static_assert(v4.size() == 0);
+#endif
+}
diff --git a/libcxx/test/std/embed/empty b/libcxx/test/std/embed/empty
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
index beecf87cd4aa7..17d50b313591f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -352,7 +352,7 @@
# error "__cpp_lib_shift should have the value 202202L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_clamp
# error "__cpp_lib_clamp should be defined in c++26"
@@ -456,6 +456,110 @@
# error "__cpp_lib_shift should have the value 202202L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_clamp
+# error "__cpp_lib_clamp should be defined in c++29"
+# endif
+# if __cpp_lib_clamp != 201603L
+# error "__cpp_lib_clamp should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_algorithms
+# error "__cpp_lib_constexpr_algorithms should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_algorithms != 202306L
+# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_algorithm
+# error "__cpp_lib_freestanding_algorithm should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_algorithm != 202311L
+# error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_algorithm
+# error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should be defined in c++29"
+# endif
+# if __cpp_lib_parallel_algorithm != 201603L
+# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_contains
+# error "__cpp_lib_ranges_contains should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_contains != 202207L
+# error "__cpp_lib_ranges_contains should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_find_last
+# error "__cpp_lib_ranges_find_last should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_find_last != 202207L
+# error "__cpp_lib_ranges_find_last should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_starts_ends_with
+# error "__cpp_lib_ranges_starts_ends_with should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_starts_ends_with != 202106L
+# error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_robust_nonmodifying_seq_ops
+# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++29"
+# endif
+# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_sample
+# error "__cpp_lib_sample should be defined in c++29"
+# endif
+# if __cpp_lib_sample != 201603L
+# error "__cpp_lib_sample should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_shift
+# error "__cpp_lib_shift should be defined in c++29"
+# endif
+# if __cpp_lib_shift != 202202L
+# error "__cpp_lib_shift should have the value 202202L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
index fe0e6bd17f94d..6c08175a5285f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/any.version.compile.pass.cpp
@@ -57,7 +57,7 @@
# error "__cpp_lib_any should have the value 201606L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_any
# error "__cpp_lib_any should be defined in c++26"
@@ -66,6 +66,15 @@
# error "__cpp_lib_any should have the value 201606L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_any
+# error "__cpp_lib_any should be defined in c++29"
+# endif
+# if __cpp_lib_any != 201606L
+# error "__cpp_lib_any should have the value 201606L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
index 30efb61893a1b..5f5dc28e5ba22 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/array.version.compile.pass.cpp
@@ -132,7 +132,7 @@
# error "__cpp_lib_to_array should have the value 201907L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_array_constexpr
# error "__cpp_lib_array_constexpr should be defined in c++26"
@@ -168,6 +168,42 @@
# error "__cpp_lib_to_array should have the value 201907L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_array_constexpr
+# error "__cpp_lib_array_constexpr should be defined in c++29"
+# endif
+# if __cpp_lib_array_constexpr != 201811L
+# error "__cpp_lib_array_constexpr should have the value 201811L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_array
+# error "__cpp_lib_freestanding_array should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_array != 202311L
+# error "__cpp_lib_freestanding_array should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_array
+# error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_to_array
+# error "__cpp_lib_to_array should be defined in c++29"
+# endif
+# if __cpp_lib_to_array != 201907L
+# error "__cpp_lib_to_array should have the value 201907L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
index e62416257a696..16ae82e8b3c59 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.compile.pass.cpp
@@ -309,7 +309,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_atomic_flag_test
# error "__cpp_lib_atomic_flag_test should be defined in c++26"
@@ -399,6 +399,96 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_atomic_flag_test
+# error "__cpp_lib_atomic_flag_test should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_flag_test != 201907L
+# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_float
+# error "__cpp_lib_atomic_float should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_float != 201711L
+# error "__cpp_lib_atomic_float should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_is_always_lock_free
+# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_is_always_lock_free != 201603L
+# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_lock_free_type_aliases
+# error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+# error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_atomic_min_max
+# error "__cpp_lib_atomic_min_max should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_min_max != 202403L
+# error "__cpp_lib_atomic_min_max should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_atomic_min_max
+# error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_atomic_ref
+# error "__cpp_lib_atomic_ref should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_ref != 202411L
+# error "__cpp_lib_atomic_ref should have the value 202411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_atomic_shared_ptr
+# error "__cpp_lib_atomic_shared_ptr should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_shared_ptr != 201711L
+# error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_atomic_shared_ptr
+# error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_atomic_value_initialization
+# error "__cpp_lib_atomic_value_initialization should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_value_initialization != 201911L
+# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_wait
+# error "__cpp_lib_atomic_wait should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_wait != 201907L
+# error "__cpp_lib_atomic_wait should have the value 201907L in c++29"
+# endif
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
index 01cda62c06a6f..4171deef44c41 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_barrier
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_barrier
+# error "__cpp_lib_barrier should be defined in c++29"
+# endif
+# if __cpp_lib_barrier != 201907L
+# error "__cpp_lib_barrier should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_barrier
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
index cad025eee3373..39df8f7ed649e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.compile.pass.cpp
@@ -155,7 +155,7 @@
# error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_bit_cast
# error "__cpp_lib_bit_cast should be defined in c++26"
@@ -192,6 +192,43 @@
# error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_bit_cast
+# error "__cpp_lib_bit_cast should be defined in c++29"
+# endif
+# if __cpp_lib_bit_cast != 201806L
+# error "__cpp_lib_bit_cast should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_bitops
+# error "__cpp_lib_bitops should be defined in c++29"
+# endif
+# if __cpp_lib_bitops != 201907L
+# error "__cpp_lib_bitops should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_byteswap
+# error "__cpp_lib_byteswap should be defined in c++29"
+# endif
+# if __cpp_lib_byteswap != 202110L
+# error "__cpp_lib_byteswap should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_endian
+# error "__cpp_lib_endian should be defined in c++29"
+# endif
+# if __cpp_lib_endian != 201907L
+# error "__cpp_lib_endian should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_int_pow2
+# error "__cpp_lib_int_pow2 should be defined in c++29"
+# endif
+# if __cpp_lib_int_pow2 != 202002L
+# error "__cpp_lib_int_pow2 should have the value 202002L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
index 8799a1f7d14e5..22c4319270521 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bitset.version.compile.pass.cpp
@@ -71,7 +71,7 @@
# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_bitset
# error "__cpp_lib_bitset should be defined in c++26"
@@ -87,6 +87,22 @@
# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_bitset
+# error "__cpp_lib_bitset should be defined in c++29"
+# endif
+# if __cpp_lib_bitset != 202306L
+# error "__cpp_lib_bitset should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_bitset
+# error "__cpp_lib_constexpr_bitset should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_bitset != 202207L
+# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
index 6ec3037c9ea45..2d1b411492134 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/charconv.version.compile.pass.cpp
@@ -98,7 +98,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constexpr_charconv
# error "__cpp_lib_constexpr_charconv should be defined in c++26"
@@ -120,6 +120,28 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constexpr_charconv
+# error "__cpp_lib_constexpr_charconv should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_charconv != 202207L
+# error "__cpp_lib_constexpr_charconv should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_to_chars
+# error "__cpp_lib_to_chars should be defined in c++29"
+# endif
+# if __cpp_lib_to_chars != 202306L
+# error "__cpp_lib_to_chars should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_to_chars
+# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
index d5d7a5da4a64d..cd65a25c408e9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.compile.pass.cpp
@@ -89,7 +89,7 @@
# error "__cpp_lib_chrono_udls should have the value 201304L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_chrono
# error "__cpp_lib_chrono should be defined in c++26"
@@ -105,6 +105,22 @@
# error "__cpp_lib_chrono_udls should have the value 201304L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_chrono
+# error "__cpp_lib_chrono should be defined in c++29"
+# endif
+# if __cpp_lib_chrono != 201611L
+# error "__cpp_lib_chrono should have the value 201611L in c++29"
+# endif
+
+# ifndef __cpp_lib_chrono_udls
+# error "__cpp_lib_chrono_udls should be defined in c++29"
+# endif
+# if __cpp_lib_chrono_udls != 201304L
+# error "__cpp_lib_chrono_udls should have the value 201304L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
index 26ebe1e3ad6b1..c257f561d39ca 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.compile.pass.cpp
@@ -159,7 +159,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_constexpr_cmath
@@ -201,6 +201,48 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_cmath != 202202L
+# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_hypot
+# error "__cpp_lib_hypot should be defined in c++29"
+# endif
+# if __cpp_lib_hypot != 201603L
+# error "__cpp_lib_hypot should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_interpolate
+# error "__cpp_lib_interpolate should be defined in c++29"
+# endif
+# if __cpp_lib_interpolate != 201902L
+# error "__cpp_lib_interpolate should have the value 201902L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_math_special_functions
+# error "__cpp_lib_math_special_functions should be defined in c++29"
+# endif
+# if __cpp_lib_math_special_functions != 201603L
+# error "__cpp_lib_math_special_functions should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_math_special_functions
+# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
index 907535a087de2..8b0bcbc9e2b3a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
@@ -54,7 +54,7 @@
# error "__cpp_lib_three_way_comparison should have the value 201907L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_three_way_comparison
# error "__cpp_lib_three_way_comparison should be defined in c++26"
@@ -63,6 +63,15 @@
# error "__cpp_lib_three_way_comparison should have the value 201907L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_three_way_comparison
+# error "__cpp_lib_three_way_comparison should be defined in c++29"
+# endif
+# if __cpp_lib_three_way_comparison != 201907L
+# error "__cpp_lib_three_way_comparison should have the value 201907L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
index 9a3a644ca5d64..388ecdd90e5d7 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.compile.pass.cpp
@@ -86,7 +86,7 @@
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_complex_udls
# error "__cpp_lib_complex_udls should be defined in c++26"
@@ -102,6 +102,22 @@
# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_complex_udls
+# error "__cpp_lib_complex_udls should be defined in c++29"
+# endif
+# if __cpp_lib_complex_udls != 201309L
+# error "__cpp_lib_complex_udls should have the value 201309L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
index 15f1d30060ef1..276930078f2e8 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.compile.pass.cpp
@@ -54,7 +54,7 @@
# error "__cpp_lib_concepts should have the value 202207L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_concepts
# error "__cpp_lib_concepts should be defined in c++26"
@@ -63,6 +63,15 @@
# error "__cpp_lib_concepts should have the value 202207L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_concepts
+# error "__cpp_lib_concepts should be defined in c++29"
+# endif
+# if __cpp_lib_concepts != 202207L
+# error "__cpp_lib_concepts should have the value 202207L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
index 24a9eca1e2346..ee52ac1a24072 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/coroutine.version.compile.pass.cpp
@@ -54,7 +54,7 @@
# error "__cpp_lib_coroutine should have the value 201902L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_coroutine
# error "__cpp_lib_coroutine should be defined in c++26"
@@ -63,6 +63,15 @@
# error "__cpp_lib_coroutine should have the value 201902L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_coroutine
+# error "__cpp_lib_coroutine should be defined in c++29"
+# endif
+# if __cpp_lib_coroutine != 201902L
+# error "__cpp_lib_coroutine should have the value 201902L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
index bc65a7f3cae00..4721ab4b20a3d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.compile.pass.cpp
@@ -57,7 +57,7 @@
# error "__cpp_lib_byte should have the value 201603L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_byte
# error "__cpp_lib_byte should be defined in c++26"
@@ -66,6 +66,15 @@
# error "__cpp_lib_byte should have the value 201603L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_byte
+# error "__cpp_lib_byte should be defined in c++29"
+# endif
+# if __cpp_lib_byte != 201603L
+# error "__cpp_lib_byte should have the value 201603L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
index 600fa2eb2e4f5..a0166dc12d59e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstdlib.version.compile.pass.cpp
@@ -57,7 +57,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_constexpr_cmath
@@ -72,6 +72,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_cmath != 202202L
+# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
index 8445aa3cf0c48..c6b8d335f5363 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/cstring.version.compile.pass.cpp
@@ -48,7 +48,7 @@
# error "__cpp_lib_freestanding_cstring should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_freestanding_cstring
@@ -63,6 +63,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_cstring
+# error "__cpp_lib_freestanding_cstring should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_cstring != 202306L
+# error "__cpp_lib_freestanding_cstring should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_cstring
+# error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
index b634f3253093e..e8dde05dd7b07 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.compile.pass.cpp
@@ -155,7 +155,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -198,6 +198,49 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/embed.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/embed.version.compile.pass.cpp
new file mode 100644
index 0000000000000..241c29bb41697
--- /dev/null
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/embed.version.compile.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING: This test was generated by generate_feature_test_macro_components.py
+// and should not be edited manually.
+
+// <embed>
+
+// Test the feature test macros defined by <embed>
+
+// clang-format off
+
+#include <embed>
+#include "test_macros.h"
+
+#if TEST_STD_VER < 14
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER == 14
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER == 17
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER == 20
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER == 23
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER == 26
+
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_embed
+# error "__cpp_lib_embed should be defined in c++29"
+# endif
+# if __cpp_lib_embed != 202606L
+# error "__cpp_lib_embed should have the value 202606L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
+
+// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
index 11d5735007f5b..8d15c9297f0d4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.compile.pass.cpp
@@ -57,7 +57,7 @@
# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_uncaught_exceptions
# error "__cpp_lib_uncaught_exceptions should be defined in c++26"
@@ -66,6 +66,15 @@
# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_uncaught_exceptions
+# error "__cpp_lib_uncaught_exceptions should be defined in c++29"
+# endif
+# if __cpp_lib_uncaught_exceptions != 201411L
+# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
index 77a6455e23302..da849ec6296d4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.compile.pass.cpp
@@ -95,7 +95,7 @@
# error "__cpp_lib_senders should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_execution
@@ -123,6 +123,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_execution
+# error "__cpp_lib_execution should be defined in c++29"
+# endif
+# if __cpp_lib_execution != 201902L
+# error "__cpp_lib_execution should have the value 201902L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_execution
+# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_senders
+# error "__cpp_lib_senders should be defined in c++29"
+# endif
+# if __cpp_lib_senders != 202406L
+# error "__cpp_lib_senders should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_senders
+# error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
index 4ec6c469dce4c..7c25c805a940e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/expected.version.compile.pass.cpp
@@ -91,7 +91,7 @@
# error "__cpp_lib_freestanding_expected should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constrained_equality
# error "__cpp_lib_constrained_equality should be defined in c++26"
@@ -120,6 +120,35 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_expected
+# error "__cpp_lib_expected should be defined in c++29"
+# endif
+# if __cpp_lib_expected != 202211L
+# error "__cpp_lib_expected should have the value 202211L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_expected
+# error "__cpp_lib_freestanding_expected should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_expected != 202311L
+# error "__cpp_lib_freestanding_expected should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_expected
+# error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
index 70ba1800f64f1..de5117a28bdbe 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.compile.pass.cpp
@@ -135,7 +135,7 @@
# error "__cpp_lib_format_path should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -176,6 +176,47 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM
+# ifndef __cpp_lib_filesystem
+# error "__cpp_lib_filesystem should be defined in c++29"
+# endif
+# if __cpp_lib_filesystem != 201703L
+# error "__cpp_lib_filesystem should have the value 201703L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_filesystem
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_format_path
+# error "__cpp_lib_format_path should be defined in c++29"
+# endif
+# if __cpp_lib_format_path != 202403L
+# error "__cpp_lib_format_path should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_format_path
+# error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
index 34820de6a53aa..d0489eadb2578 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_map.version.compile.pass.cpp
@@ -71,7 +71,7 @@
# error "__cpp_lib_flat_map should have the value 202511L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constexpr_flat_map
# error "__cpp_lib_constexpr_flat_map should be defined in c++26"
@@ -87,6 +87,22 @@
# error "__cpp_lib_flat_map should have the value 202511L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constexpr_flat_map
+# error "__cpp_lib_constexpr_flat_map should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_flat_map != 202502L
+# error "__cpp_lib_constexpr_flat_map should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_flat_map
+# error "__cpp_lib_flat_map should be defined in c++29"
+# endif
+# if __cpp_lib_flat_map != 202511L
+# error "__cpp_lib_flat_map should have the value 202511L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
index 725e5107c8997..7c1cba1d1d578 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
@@ -71,7 +71,7 @@
# error "__cpp_lib_flat_set should have the value 202511L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constexpr_flat_set
# error "__cpp_lib_constexpr_flat_set should be defined in c++26"
@@ -87,6 +87,22 @@
# error "__cpp_lib_flat_set should have the value 202511L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constexpr_flat_set
+# error "__cpp_lib_constexpr_flat_set should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_flat_set != 202502L
+# error "__cpp_lib_constexpr_flat_set should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_flat_set
+# error "__cpp_lib_flat_set should be defined in c++29"
+# endif
+# if __cpp_lib_flat_set != 202511L
+# error "__cpp_lib_flat_set should have the value 202511L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
index 77730f17fd9c6..af6a25c057c2f 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp
@@ -115,7 +115,7 @@
# error "__cpp_lib_format_uchar should have the value 202311L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_format
@@ -144,6 +144,35 @@
# error "__cpp_lib_format_uchar should have the value 202311L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+# ifndef __cpp_lib_format
+# error "__cpp_lib_format should be defined in c++29"
+# endif
+# if __cpp_lib_format != 202110L
+# error "__cpp_lib_format should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_format
+# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_format_ranges != 202207L
+# error "__cpp_lib_format_ranges should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should be defined in c++29"
+# endif
+# if __cpp_lib_format_uchar != 202311L
+# error "__cpp_lib_format_uchar should have the value 202311L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
index d2082946597cb..e2e7c750decd2 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.compile.pass.cpp
@@ -230,7 +230,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -294,6 +294,70 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_forward_list
+# error "__cpp_lib_constexpr_forward_list should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_forward_list != 202502L
+# error "__cpp_lib_constexpr_forward_list should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_incomplete_container_elements
+# error "__cpp_lib_incomplete_container_elements should be defined in c++29"
+# endif
+# if __cpp_lib_incomplete_container_elements != 201505L
+# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++29"
+# endif
+
+# ifndef __cpp_lib_list_remove_return_type
+# error "__cpp_lib_list_remove_return_type should be defined in c++29"
+# endif
+# if __cpp_lib_list_remove_return_type != 201806L
+# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
index f67adb0de1ded..56a41997c2b35 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/fstream.version.compile.pass.cpp
@@ -50,7 +50,7 @@
# error "__cpp_lib_fstream_native_handle should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
# ifndef __cpp_lib_fstream_native_handle
@@ -65,6 +65,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
+# ifndef __cpp_lib_fstream_native_handle
+# error "__cpp_lib_fstream_native_handle should be defined in c++29"
+# endif
+# if __cpp_lib_fstream_native_handle != 202306L
+# error "__cpp_lib_fstream_native_handle should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_fstream_native_handle
+# error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
index b7b7d0334830a..b6ddfd2c68e82 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
@@ -444,7 +444,7 @@
# error "__cpp_lib_unwrap_ref should have the value 201811L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_bind_back
# error "__cpp_lib_bind_back should be defined in c++26"
@@ -576,6 +576,138 @@
# error "__cpp_lib_unwrap_ref should have the value 201811L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_bind_back
+# error "__cpp_lib_bind_back should be defined in c++29"
+# endif
+# if __cpp_lib_bind_back != 202202L
+# error "__cpp_lib_bind_back should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_bind_front
+# error "__cpp_lib_bind_front should be defined in c++29"
+# endif
+# if __cpp_lib_bind_front != 202306L
+# error "__cpp_lib_bind_front should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_boyer_moore_searcher
+# error "__cpp_lib_boyer_moore_searcher should be defined in c++29"
+# endif
+# if __cpp_lib_boyer_moore_searcher != 201603L
+# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_common_reference_wrapper
+# error "__cpp_lib_common_reference_wrapper should be defined in c++29"
+# endif
+# if __cpp_lib_common_reference_wrapper != 202302L
+# error "__cpp_lib_common_reference_wrapper should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_functional
+# error "__cpp_lib_constexpr_functional should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+# error "__cpp_lib_constexpr_functional should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_copyable_function
+# error "__cpp_lib_copyable_function should be defined in c++29"
+# endif
+# if __cpp_lib_copyable_function != 202306L
+# error "__cpp_lib_copyable_function should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_copyable_function
+# error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_function_ref
+# error "__cpp_lib_function_ref should be defined in c++29"
+# endif
+# if __cpp_lib_function_ref != 202306L
+# error "__cpp_lib_function_ref should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_function_ref
+# error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_invoke
+# error "__cpp_lib_invoke should be defined in c++29"
+# endif
+# if __cpp_lib_invoke != 201411L
+# error "__cpp_lib_invoke should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_invoke_r
+# error "__cpp_lib_invoke_r should be defined in c++29"
+# endif
+# if __cpp_lib_invoke_r != 202106L
+# error "__cpp_lib_invoke_r should have the value 202106L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_move_only_function
+# error "__cpp_lib_move_only_function should be defined in c++29"
+# endif
+# if __cpp_lib_move_only_function != 202110L
+# error "__cpp_lib_move_only_function should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_move_only_function
+# error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_not_fn
+# error "__cpp_lib_not_fn should be defined in c++29"
+# endif
+# if __cpp_lib_not_fn != 202306L
+# error "__cpp_lib_not_fn should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# ifndef __cpp_lib_reference_wrapper
+# error "__cpp_lib_reference_wrapper should be defined in c++29"
+# endif
+# if __cpp_lib_reference_wrapper != 202403L
+# error "__cpp_lib_reference_wrapper should have the value 202403L in c++29"
+# endif
+
+# ifndef __cpp_lib_result_of_sfinae
+# error "__cpp_lib_result_of_sfinae should be defined in c++29"
+# endif
+# if __cpp_lib_result_of_sfinae != 201210L
+# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++29"
+# endif
+
+# ifndef __cpp_lib_transparent_operators
+# error "__cpp_lib_transparent_operators should be defined in c++29"
+# endif
+# if __cpp_lib_transparent_operators != 201510L
+# error "__cpp_lib_transparent_operators should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_unwrap_ref
+# error "__cpp_lib_unwrap_ref should be defined in c++29"
+# endif
+# if __cpp_lib_unwrap_ref != 201811L
+# error "__cpp_lib_unwrap_ref should have the value 201811L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
index 4de327cbfa26b..33e11f3d6afa2 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.compile.pass.cpp
@@ -86,7 +86,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
# ifndef __cpp_lib_quoted_string_io
@@ -101,6 +101,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+# ifndef __cpp_lib_quoted_string_io
+# error "__cpp_lib_quoted_string_io should be defined in c++29"
+# endif
+# if __cpp_lib_quoted_string_io != 201304L
+# error "__cpp_lib_quoted_string_io should have the value 201304L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_quoted_string_io
+# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
index 68816936c55e9..91c5f7c1f5901 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ios.version.compile.pass.cpp
@@ -53,7 +53,7 @@
# error "__cpp_lib_ios_noreplace should have the value 202207L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_ios_noreplace
# error "__cpp_lib_ios_noreplace should be defined in c++26"
@@ -62,6 +62,15 @@
# error "__cpp_lib_ios_noreplace should have the value 202207L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_ios_noreplace
+# error "__cpp_lib_ios_noreplace should be defined in c++29"
+# endif
+# if __cpp_lib_ios_noreplace != 202207L
+# error "__cpp_lib_ios_noreplace should have the value 202207L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
index a1178b22776f1..42e95edb5d7da 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
index e9805ed4b1542..bb251f001b42a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
@@ -254,7 +254,7 @@
# error "__cpp_lib_ssize should have the value 201902L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_array_constexpr
# error "__cpp_lib_array_constexpr should be defined in c++26"
@@ -312,6 +312,64 @@
# error "__cpp_lib_ssize should have the value 201902L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_array_constexpr
+# error "__cpp_lib_array_constexpr should be defined in c++29"
+# endif
+# if __cpp_lib_array_constexpr != 201811L
+# error "__cpp_lib_array_constexpr should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_iterator
+# error "__cpp_lib_constexpr_iterator should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_iterator != 201811L
+# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_reverse_iterator
+# error "__cpp_lib_make_reverse_iterator should be defined in c++29"
+# endif
+# if __cpp_lib_make_reverse_iterator != 201402L
+# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++29"
+# endif
+
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++29"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_null_iterators
+# error "__cpp_lib_null_iterators should be defined in c++29"
+# endif
+# if __cpp_lib_null_iterators != 201304L
+# error "__cpp_lib_null_iterators should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# ifndef __cpp_lib_ssize
+# error "__cpp_lib_ssize should be defined in c++29"
+# endif
+# if __cpp_lib_ssize != 201902L
+# error "__cpp_lib_ssize should have the value 201902L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
index 8be3c800c9ba8..f593764cd8c85 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_latch
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_latch
+# error "__cpp_lib_latch should be defined in c++29"
+# endif
+# if __cpp_lib_latch != 201907L
+# error "__cpp_lib_latch should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_latch
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
index f4cc8db0f54cb..fb18e3a88a693 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp
@@ -66,7 +66,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -81,6 +81,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
index 1407d74e03aa2..15aa665c0fea0 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/list.version.compile.pass.cpp
@@ -230,7 +230,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -294,6 +294,70 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_list
+# error "__cpp_lib_constexpr_list should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_list != 202502L
+# error "__cpp_lib_constexpr_list should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_incomplete_container_elements
+# error "__cpp_lib_incomplete_container_elements should be defined in c++29"
+# endif
+# if __cpp_lib_incomplete_container_elements != 201505L
+# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++29"
+# endif
+
+# ifndef __cpp_lib_list_remove_return_type
+# error "__cpp_lib_list_remove_return_type should be defined in c++29"
+# endif
+# if __cpp_lib_list_remove_return_type != 201806L
+# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
index f516881651b23..2b93c27899adc 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
index 3db3861c72b5c..6c5a4a860b7b0 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/map.version.compile.pass.cpp
@@ -303,7 +303,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -393,6 +393,96 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_erasure != 202110L
+# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_insertion != 202306L
+# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_generic_associative_lookup
+# error "__cpp_lib_generic_associative_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_associative_lookup != 201304L
+# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_map_try_emplace
+# error "__cpp_lib_map_try_emplace should be defined in c++29"
+# endif
+# if __cpp_lib_map_try_emplace != 201411L
+# error "__cpp_lib_map_try_emplace should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_node_extract
+# error "__cpp_lib_node_extract should be defined in c++29"
+# endif
+# if __cpp_lib_node_extract != 201606L
+# error "__cpp_lib_node_extract should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_like != 202311L
+# error "__cpp_lib_tuple_like should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
index fad0e5b9777dd..051a307d31890 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/mdspan.version.compile.pass.cpp
@@ -111,7 +111,7 @@
# error "__cpp_lib_submdspan should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_aligned_accessor
# error "__cpp_lib_aligned_accessor should be defined in c++26"
@@ -153,6 +153,48 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_aligned_accessor
+# error "__cpp_lib_aligned_accessor should be defined in c++29"
+# endif
+# if __cpp_lib_aligned_accessor != 202411L
+# error "__cpp_lib_aligned_accessor should have the value 202411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_mdspan
+# error "__cpp_lib_freestanding_mdspan should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_mdspan != 202311L
+# error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_mdspan
+# error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_mdspan
+# error "__cpp_lib_mdspan should be defined in c++29"
+# endif
+# if __cpp_lib_mdspan != 202406L
+# error "__cpp_lib_mdspan should have the value 202406L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_submdspan
+# error "__cpp_lib_submdspan should be defined in c++29"
+# endif
+# if __cpp_lib_submdspan != 202306L
+# error "__cpp_lib_submdspan should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_submdspan
+# error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
index f287e1ad9b3ad..db7e309a582c5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
@@ -534,7 +534,7 @@
# error "__cpp_lib_transparent_operators should have the value 201510L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_addressof_constexpr
# error "__cpp_lib_addressof_constexpr should be defined in c++26"
@@ -675,6 +675,147 @@
# error "__cpp_lib_transparent_operators should have the value 201510L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_addressof_constexpr
+# error "__cpp_lib_addressof_constexpr should be defined in c++29"
+# endif
+# if __cpp_lib_addressof_constexpr != 201603L
+# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_allocate_at_least
+# error "__cpp_lib_allocate_at_least should be defined in c++29"
+# endif
+# if __cpp_lib_allocate_at_least != 202302L
+# error "__cpp_lib_allocate_at_least should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_assume_aligned
+# error "__cpp_lib_assume_aligned should be defined in c++29"
+# endif
+# if __cpp_lib_assume_aligned != 201811L
+# error "__cpp_lib_assume_aligned should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_value_initialization
+# error "__cpp_lib_atomic_value_initialization should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_value_initialization != 201911L
+# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_dynamic_alloc
+# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_dynamic_alloc != 201907L
+# error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_memory
+# error "__cpp_lib_constexpr_memory should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_memory != 202202L
+# error "__cpp_lib_constexpr_memory should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_enable_shared_from_this
+# error "__cpp_lib_enable_shared_from_this should be defined in c++29"
+# endif
+# if __cpp_lib_enable_shared_from_this != 201603L
+# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_sufficiently_aligned
+# error "__cpp_lib_is_sufficiently_aligned should be defined in c++29"
+# endif
+# if __cpp_lib_is_sufficiently_aligned != 202411L
+# error "__cpp_lib_is_sufficiently_aligned should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_unique
+# error "__cpp_lib_make_unique should be defined in c++29"
+# endif
+# if __cpp_lib_make_unique != 201304L
+# error "__cpp_lib_make_unique should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_out_ptr
+# error "__cpp_lib_out_ptr should be defined in c++29"
+# endif
+# if __cpp_lib_out_ptr != 202311L
+# error "__cpp_lib_out_ptr should have the value 202311L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# ifndef __cpp_lib_raw_memory_algorithms
+# error "__cpp_lib_raw_memory_algorithms should be defined in c++29"
+# endif
+# if __cpp_lib_raw_memory_algorithms != 201606L
+# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_shared_ptr_arrays
+# error "__cpp_lib_shared_ptr_arrays should be defined in c++29"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201707L
+# error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++29"
+# endif
+
+# ifndef __cpp_lib_shared_ptr_weak_type
+# error "__cpp_lib_shared_ptr_weak_type should be defined in c++29"
+# endif
+# if __cpp_lib_shared_ptr_weak_type != 201606L
+# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++29"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_smart_ptr_owner_equality
+# error "__cpp_lib_smart_ptr_owner_equality should be defined in c++29"
+# endif
+# if __cpp_lib_smart_ptr_owner_equality != 202306L
+# error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_smart_ptr_owner_equality
+# error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_to_address
+# error "__cpp_lib_to_address should be defined in c++29"
+# endif
+# if __cpp_lib_to_address != 201711L
+# error "__cpp_lib_to_address should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_transparent_operators
+# error "__cpp_lib_transparent_operators should be defined in c++29"
+# endif
+# if __cpp_lib_transparent_operators != 201510L
+# error "__cpp_lib_transparent_operators should have the value 201510L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
index dddf473f86a42..045e7c280e049 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
@@ -113,7 +113,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
# ifndef __cpp_lib_memory_resource
@@ -141,6 +141,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++29"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++29"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
index 5ffa5df8841c9..faa8f5b9fe960 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.compile.pass.cpp
@@ -77,7 +77,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_scoped_lock
@@ -92,6 +92,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_scoped_lock
+# error "__cpp_lib_scoped_lock should be defined in c++29"
+# endif
+# if __cpp_lib_scoped_lock != 201703L
+# error "__cpp_lib_scoped_lock should have the value 201703L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_scoped_lock
+# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
index fd2332f104f3e..7b6e3b152dd8e 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/new.version.compile.pass.cpp
@@ -144,7 +144,7 @@
# error "__cpp_lib_launder should have the value 201606L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_ABI_VCRUNTIME)
# ifndef __cpp_lib_constexpr_new
@@ -186,6 +186,48 @@
# error "__cpp_lib_launder should have the value 201606L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_ABI_VCRUNTIME)
+# ifndef __cpp_lib_constexpr_new
+# error "__cpp_lib_constexpr_new should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_new != 202406L
+# error "__cpp_lib_constexpr_new should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_constexpr_new
+# error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
+# endif
+# endif
+
+# if defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+# ifndef __cpp_lib_destroying_delete
+# error "__cpp_lib_destroying_delete should be defined in c++29"
+# endif
+# if __cpp_lib_destroying_delete != 201806L
+# error "__cpp_lib_destroying_delete should have the value 201806L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_destroying_delete
+# error "__cpp_lib_destroying_delete should not be defined when the requirement 'defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_hardware_interference_size
+# error "__cpp_lib_hardware_interference_size should be defined in c++29"
+# endif
+# if __cpp_lib_hardware_interference_size != 201703L
+# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++29"
+# endif
+
+# ifndef __cpp_lib_launder
+# error "__cpp_lib_launder should be defined in c++29"
+# endif
+# if __cpp_lib_launder != 201606L
+# error "__cpp_lib_launder should have the value 201606L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
index 27170d1ea0ce7..8e6bed209fd25 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.compile.pass.cpp
@@ -54,7 +54,7 @@
# error "__cpp_lib_math_constants should have the value 201907L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_math_constants
# error "__cpp_lib_math_constants should be defined in c++26"
@@ -63,6 +63,15 @@
# error "__cpp_lib_math_constants should have the value 201907L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_math_constants
+# error "__cpp_lib_math_constants should be defined in c++29"
+# endif
+# if __cpp_lib_math_constants != 201907L
+# error "__cpp_lib_math_constants should have the value 201907L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
index d629407c9b645..6dce9ac283318 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp
@@ -199,7 +199,7 @@
# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constexpr_numeric
# error "__cpp_lib_constexpr_numeric should be defined in c++26"
@@ -249,6 +249,56 @@
# error "__cpp_lib_saturation_arithmetic should have the value 202603L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constexpr_numeric
+# error "__cpp_lib_constexpr_numeric should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_numeric != 201911L
+# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++29"
+# endif
+
+# ifndef __cpp_lib_gcd_lcm
+# error "__cpp_lib_gcd_lcm should be defined in c++29"
+# endif
+# if __cpp_lib_gcd_lcm != 201606L
+# error "__cpp_lib_gcd_lcm should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_interpolate
+# error "__cpp_lib_interpolate should be defined in c++29"
+# endif
+# if __cpp_lib_interpolate != 201902L
+# error "__cpp_lib_interpolate should have the value 201902L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should be defined in c++29"
+# endif
+# if __cpp_lib_parallel_algorithm != 201603L
+# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_iota
+# error "__cpp_lib_ranges_iota should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_iota != 202202L
+# error "__cpp_lib_ranges_iota should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should be defined in c++29"
+# endif
+# if __cpp_lib_saturation_arithmetic != 202311L
+# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
index 9850c20afec87..63808fd08ed13 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.compile.pass.cpp
@@ -117,7 +117,7 @@
# error "__cpp_lib_optional_range_support should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constrained_equality
# error "__cpp_lib_constrained_equality should be defined in c++26"
@@ -159,6 +159,48 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_optional
+# error "__cpp_lib_freestanding_optional should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_optional != 202311L
+# error "__cpp_lib_freestanding_optional should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_optional
+# error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_optional
+# error "__cpp_lib_optional should be defined in c++29"
+# endif
+# if __cpp_lib_optional != 202506L
+# error "__cpp_lib_optional should have the value 202506L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
+# ifndef __cpp_lib_optional_range_support
+# error "__cpp_lib_optional_range_support should be defined in c++29"
+# endif
+# if __cpp_lib_optional_range_support != 202406L
+# error "__cpp_lib_optional_range_support should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_optional_range_support
+# error "__cpp_lib_optional_range_support should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
index 163ea5b5514e4..94c4c8c067b75 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.compile.pass.cpp
@@ -97,7 +97,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -125,6 +125,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+# ifndef __cpp_lib_print
+# error "__cpp_lib_print should be defined in c++29"
+# endif
+# if __cpp_lib_print != 202207L
+# error "__cpp_lib_print should have the value 202207L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_print
+# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
index 0382d93cb40c9..c0bba4f493557 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/print.version.compile.pass.cpp
@@ -59,7 +59,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
# ifndef __cpp_lib_print
@@ -74,6 +74,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+# ifndef __cpp_lib_print
+# error "__cpp_lib_print should be defined in c++29"
+# endif
+# if __cpp_lib_print != 202207L
+# error "__cpp_lib_print should have the value 202207L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_print
+# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
index db32433ff518e..8747e421f84c4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/queue.version.compile.pass.cpp
@@ -94,7 +94,7 @@
# error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_adaptor_iterator_pair_constructor
# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
@@ -117,6 +117,29 @@
# error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_adaptor_iterator_pair_constructor
+# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++29"
+# endif
+# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_queue
+# error "__cpp_lib_constexpr_queue should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_queue != 202502L
+# error "__cpp_lib_constexpr_queue should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
index d0ede1168dfa1..d80581f227ccd 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/random.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# error "__cpp_lib_philox_engine should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_generate_random
@@ -96,6 +96,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_generate_random
+# error "__cpp_lib_generate_random should be defined in c++29"
+# endif
+# if __cpp_lib_generate_random != 202403L
+# error "__cpp_lib_generate_random should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_generate_random
+# error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_philox_engine
+# error "__cpp_lib_philox_engine should be defined in c++29"
+# endif
+# if __cpp_lib_philox_engine != 202406L
+# error "__cpp_lib_philox_engine should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_philox_engine
+# error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
index 6825f9675d459..553dca7d9efff 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
@@ -385,7 +385,7 @@
# error "__cpp_lib_ranges_zip should have the value 202110L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_default_template_type_for_algorithm_values
@@ -522,6 +522,129 @@
# error "__cpp_lib_ranges_zip should have the value 202110L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_as_const
+# error "__cpp_lib_ranges_as_const should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_as_const != 202207L
+# error "__cpp_lib_ranges_as_const should have the value 202207L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_as_const
+# error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_as_rvalue != 202207L
+# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_chunk
+# error "__cpp_lib_ranges_chunk should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_chunk != 202202L
+# error "__cpp_lib_ranges_chunk should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_chunk
+# error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_chunk_by
+# error "__cpp_lib_ranges_chunk_by should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_chunk_by != 202202L
+# error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_concat
+# error "__cpp_lib_ranges_concat should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_concat != 202403L
+# error "__cpp_lib_ranges_concat should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_concat
+# error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_indices
+# error "__cpp_lib_ranges_indices should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_indices != 202506L
+# error "__cpp_lib_ranges_indices should have the value 202506L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_join_with
+# error "__cpp_lib_ranges_join_with should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_join_with != 202202L
+# error "__cpp_lib_ranges_join_with should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_repeat
+# error "__cpp_lib_ranges_repeat should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_repeat != 202207L
+# error "__cpp_lib_ranges_repeat should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_slide
+# error "__cpp_lib_ranges_slide should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_slide != 202202L
+# error "__cpp_lib_ranges_slide should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_slide
+# error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_to_container
+# error "__cpp_lib_ranges_to_container should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_to_container != 202202L
+# error "__cpp_lib_ranges_to_container should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_zip
+# error "__cpp_lib_ranges_zip should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_zip != 202110L
+# error "__cpp_lib_ranges_zip should have the value 202110L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
index b7c08fe0de42c..faf0b608a4a7b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/ratio.version.compile.pass.cpp
@@ -48,7 +48,7 @@
# error "__cpp_lib_ratio should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_ratio
# error "__cpp_lib_ratio should be defined in c++26"
@@ -57,6 +57,15 @@
# error "__cpp_lib_ratio should have the value 202306L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_ratio
+# error "__cpp_lib_ratio should be defined in c++29"
+# endif
+# if __cpp_lib_ratio != 202306L
+# error "__cpp_lib_ratio should have the value 202306L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
index dc27dc91851a5..a104ddad5367d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.compile.pass.cpp
@@ -59,7 +59,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_nonmember_container_access
# error "__cpp_lib_nonmember_container_access should be defined in c++26"
@@ -68,6 +68,15 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
index 9dc2d8b876640..fd627a2b82e29 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.compile.pass.cpp
@@ -57,7 +57,7 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -66,6 +66,15 @@
# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
index 9912804043c48..97526117370bc 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_semaphore
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_semaphore
+# error "__cpp_lib_semaphore should be defined in c++29"
+# endif
+# if __cpp_lib_semaphore != 201907L
+# error "__cpp_lib_semaphore should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_semaphore
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
index 5dc69f29d0ecd..aa7545c008bda 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/set.version.compile.pass.cpp
@@ -245,7 +245,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -315,6 +315,76 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_erasure != 202110L
+# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_insertion != 202306L
+# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_generic_associative_lookup
+# error "__cpp_lib_generic_associative_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_associative_lookup != 201304L
+# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_node_extract
+# error "__cpp_lib_node_extract should be defined in c++29"
+# endif
+# if __cpp_lib_node_extract != 201606L
+# error "__cpp_lib_node_extract should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
index 51feff2195c3d..8cd96283ad1ac 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.compile.pass.cpp
@@ -133,7 +133,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_shared_mutex
@@ -161,6 +161,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_shared_mutex
+# error "__cpp_lib_shared_mutex should be defined in c++29"
+# endif
+# if __cpp_lib_shared_mutex != 201505L
+# error "__cpp_lib_shared_mutex should have the value 201505L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_shared_mutex
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_shared_timed_mutex
+# error "__cpp_lib_shared_timed_mutex should be defined in c++29"
+# endif
+# if __cpp_lib_shared_timed_mutex != 201402L
+# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_shared_timed_mutex
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
index 9495e319521c1..d89049ce4ad32 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/source_location.version.compile.pass.cpp
@@ -54,7 +54,7 @@
# error "__cpp_lib_source_location should have the value 201907L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_source_location
# error "__cpp_lib_source_location should be defined in c++26"
@@ -63,6 +63,15 @@
# error "__cpp_lib_source_location should have the value 201907L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_source_location
+# error "__cpp_lib_source_location should be defined in c++29"
+# endif
+# if __cpp_lib_source_location != 201907L
+# error "__cpp_lib_source_location should have the value 201907L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
index 28c54acd0fda2..c21f9c9ebabe3 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/span.version.compile.pass.cpp
@@ -74,7 +74,11 @@
# error "__cpp_lib_span_at should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+# ifdef __cpp_lib_span_initializer_list
+# error "__cpp_lib_span_initializer_list should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_span
# error "__cpp_lib_span should be defined in c++26"
@@ -90,6 +94,36 @@
# error "__cpp_lib_span_at should have the value 202311L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+# ifndef __cpp_lib_span_initializer_list
+# error "__cpp_lib_span_initializer_list should be defined in c++26"
+# endif
+# if __cpp_lib_span_initializer_list != 202311L
+# error "__cpp_lib_span_initializer_list should have the value 202311L in c++26"
+# endif
+
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_span
+# error "__cpp_lib_span should be defined in c++29"
+# endif
+# if __cpp_lib_span != 202002L
+# error "__cpp_lib_span should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_span_at
+# error "__cpp_lib_span_at should be defined in c++29"
+# endif
+# if __cpp_lib_span_at != 202311L
+# error "__cpp_lib_span_at should have the value 202311L in c++29"
+# endif
+
+# ifndef __cpp_lib_span_initializer_list
+# error "__cpp_lib_span_initializer_list should be defined in c++29"
+# endif
+# if __cpp_lib_span_initializer_list != 202311L
+# error "__cpp_lib_span_initializer_list should have the value 202311L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
index 992e31ed602e3..e07860e349da6 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/sstream.version.compile.pass.cpp
@@ -50,7 +50,7 @@
# error "__cpp_lib_sstream_from_string_view should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_sstream_from_string_view
# error "__cpp_lib_sstream_from_string_view should be defined in c++26"
@@ -59,6 +59,15 @@
# error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_sstream_from_string_view
+# error "__cpp_lib_sstream_from_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_sstream_from_string_view != 202306L
+# error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
index 61c5ed476228c..cc06307be967c 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stack.version.compile.pass.cpp
@@ -74,7 +74,7 @@
# error "__cpp_lib_containers_ranges should have the value 202202L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_adaptor_iterator_pair_constructor
# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
@@ -90,6 +90,22 @@
# error "__cpp_lib_containers_ranges should have the value 202202L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_adaptor_iterator_pair_constructor
+# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++29"
+# endif
+# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
index c07d935106ea6..15686fdbbeb03 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stdatomic.h.version.compile.pass.cpp
@@ -53,7 +53,7 @@
# error "__cpp_lib_stdatomic_h should have the value 202011L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_stdatomic_h
# error "__cpp_lib_stdatomic_h should be defined in c++26"
@@ -62,6 +62,15 @@
# error "__cpp_lib_stdatomic_h should have the value 202011L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_stdatomic_h
+# error "__cpp_lib_stdatomic_h should be defined in c++29"
+# endif
+# if __cpp_lib_stdatomic_h != 202011L
+# error "__cpp_lib_stdatomic_h should have the value 202011L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
index 1c240cee3bdcf..6ee50693a00ac 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/stop_token.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
# ifndef __cpp_lib_jthread
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_jthread
+# error "__cpp_lib_jthread should be defined in c++29"
+# endif
+# if __cpp_lib_jthread != 201911L
+# error "__cpp_lib_jthread should have the value 201911L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_jthread
+# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
index 147854eead2cc..bcc78a9a4143d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/string.version.compile.pass.cpp
@@ -392,7 +392,7 @@
# error "__cpp_lib_to_string should not be defined before c++26"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -510,6 +510,124 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_constexpr_string
+# error "__cpp_lib_constexpr_string should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_string != 201907L
+# error "__cpp_lib_constexpr_string should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_starts_ends_with
+# error "__cpp_lib_starts_ends_with should be defined in c++29"
+# endif
+# if __cpp_lib_starts_ends_with != 201711L
+# error "__cpp_lib_starts_ends_with should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_contains
+# error "__cpp_lib_string_contains should be defined in c++29"
+# endif
+# if __cpp_lib_string_contains != 202011L
+# error "__cpp_lib_string_contains should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_resize_and_overwrite
+# error "__cpp_lib_string_resize_and_overwrite should be defined in c++29"
+# endif
+# if __cpp_lib_string_resize_and_overwrite != 202110L
+# error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_subview
+# error "__cpp_lib_string_subview should be defined in c++29"
+# endif
+# if __cpp_lib_string_subview != 202506L
+# error "__cpp_lib_string_subview should have the value 202506L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_udls
+# error "__cpp_lib_string_udls should be defined in c++29"
+# endif
+# if __cpp_lib_string_udls != 201304L
+# error "__cpp_lib_string_udls should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_view
+# error "__cpp_lib_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_string_view != 202403L
+# error "__cpp_lib_string_view should have the value 202403L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_to_string
+# error "__cpp_lib_to_string should be defined in c++29"
+# endif
+# if __cpp_lib_to_string != 202306L
+# error "__cpp_lib_to_string should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_to_string
+# error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
index 2c3716111102a..5b3f63883d2e8 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.compile.pass.cpp
@@ -210,7 +210,7 @@
# error "__cpp_lib_string_view should have the value 201803L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if defined(__cpp_char8_t)
# ifndef __cpp_lib_char8_t
@@ -273,6 +273,69 @@
# error "__cpp_lib_string_view should have the value 202403L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_constexpr_string_view
+# error "__cpp_lib_constexpr_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_string_view != 201811L
+# error "__cpp_lib_constexpr_string_view should have the value 201811L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_string_view
+# error "__cpp_lib_freestanding_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_string_view != 202311L
+# error "__cpp_lib_freestanding_string_view should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_string_view
+# error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_starts_ends_with
+# error "__cpp_lib_starts_ends_with should be defined in c++29"
+# endif
+# if __cpp_lib_starts_ends_with != 201711L
+# error "__cpp_lib_starts_ends_with should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_contains
+# error "__cpp_lib_string_contains should be defined in c++29"
+# endif
+# if __cpp_lib_string_contains != 202011L
+# error "__cpp_lib_string_contains should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_subview
+# error "__cpp_lib_string_subview should be defined in c++29"
+# endif
+# if __cpp_lib_string_subview != 202506L
+# error "__cpp_lib_string_subview should have the value 202506L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_view
+# error "__cpp_lib_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_string_view != 202403L
+# error "__cpp_lib_string_view should have the value 202403L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
index 589b9ba5a75df..5b935275fada6 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
@@ -68,7 +68,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
# ifndef __cpp_lib_syncbuf
@@ -83,6 +83,21 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+# ifndef __cpp_lib_syncbuf
+# error "__cpp_lib_syncbuf should be defined in c++29"
+# endif
+# if __cpp_lib_syncbuf != 201803L
+# error "__cpp_lib_syncbuf should have the value 201803L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_syncbuf
+# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
index 6b422f28dd792..a34afd4f5c65b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.compile.pass.cpp
@@ -97,7 +97,7 @@
# endif
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_formatters
@@ -125,6 +125,34 @@
# endif
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_formatters
+# error "__cpp_lib_formatters should be defined in c++29"
+# endif
+# if __cpp_lib_formatters != 202302L
+# error "__cpp_lib_formatters should have the value 202302L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_jthread
+# error "__cpp_lib_jthread should be defined in c++29"
+# endif
+# if __cpp_lib_jthread != 201911L
+# error "__cpp_lib_jthread should have the value 201911L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_jthread
+# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
index c0973c03f3273..9f499f074c30a 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.compile.pass.cpp
@@ -248,7 +248,7 @@
# error "__cpp_lib_tuples_by_type should have the value 201304L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_apply
# error "__cpp_lib_apply should be defined in c++26"
@@ -312,6 +312,70 @@
# error "__cpp_lib_tuples_by_type should have the value 201304L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_apply
+# error "__cpp_lib_apply should be defined in c++29"
+# endif
+# if __cpp_lib_apply != 201603L
+# error "__cpp_lib_apply should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_tuple
+# error "__cpp_lib_constexpr_tuple should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_tuple != 201811L
+# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_from_tuple
+# error "__cpp_lib_make_from_tuple should be defined in c++29"
+# endif
+# if __cpp_lib_make_from_tuple != 201606L
+# error "__cpp_lib_make_from_tuple should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_zip
+# error "__cpp_lib_ranges_zip should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_zip != 202110L
+# error "__cpp_lib_ranges_zip should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_tuple_element_t
+# error "__cpp_lib_tuple_element_t should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_element_t != 201402L
+# error "__cpp_lib_tuple_element_t should have the value 201402L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_like != 202311L
+# error "__cpp_lib_tuple_like should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_tuples_by_type
+# error "__cpp_lib_tuples_by_type should be defined in c++29"
+# endif
+# if __cpp_lib_tuples_by_type != 201304L
+# error "__cpp_lib_tuples_by_type should have the value 201304L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
index cb5c008f16bb3..fbceb1410fab8 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
@@ -773,7 +773,7 @@
# error "__cpp_lib_void_t should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_bool_constant
# error "__cpp_lib_bool_constant should be defined in c++26"
@@ -993,6 +993,226 @@
# error "__cpp_lib_void_t should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_bool_constant
+# error "__cpp_lib_bool_constant should be defined in c++29"
+# endif
+# if __cpp_lib_bool_constant != 201505L
+# error "__cpp_lib_bool_constant should have the value 201505L in c++29"
+# endif
+
+# ifndef __cpp_lib_bounded_array_traits
+# error "__cpp_lib_bounded_array_traits should be defined in c++29"
+# endif
+# if __cpp_lib_bounded_array_traits != 201902L
+# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++29"
+# endif
+
+# ifndef __cpp_lib_common_reference
+# error "__cpp_lib_common_reference should be defined in c++29"
+# endif
+# if __cpp_lib_common_reference != 202302L
+# error "__cpp_lib_common_reference should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_has_unique_object_representations
+# error "__cpp_lib_has_unique_object_representations should be defined in c++29"
+# endif
+# if __cpp_lib_has_unique_object_representations != 201606L
+# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_integral_constant_callable
+# error "__cpp_lib_integral_constant_callable should be defined in c++29"
+# endif
+# if __cpp_lib_integral_constant_callable != 201304L
+# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_aggregate
+# error "__cpp_lib_is_aggregate should be defined in c++29"
+# endif
+# if __cpp_lib_is_aggregate != 201703L
+# error "__cpp_lib_is_aggregate should have the value 201703L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_constant_evaluated
+# error "__cpp_lib_is_constant_evaluated should be defined in c++29"
+# endif
+# if __cpp_lib_is_constant_evaluated != 201811L
+# error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_final
+# error "__cpp_lib_is_final should be defined in c++29"
+# endif
+# if __cpp_lib_is_final != 201402L
+# error "__cpp_lib_is_final should have the value 201402L in c++29"
+# endif
+
+# if __has_builtin(__builtin_is_implicit_lifetime)
+# ifndef __cpp_lib_is_implicit_lifetime
+# error "__cpp_lib_is_implicit_lifetime should be defined in c++29"
+# endif
+# if __cpp_lib_is_implicit_lifetime != 202302L
+# error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_implicit_lifetime
+# error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_invocable
+# error "__cpp_lib_is_invocable should be defined in c++29"
+# endif
+# if __cpp_lib_is_invocable != 201703L
+# error "__cpp_lib_is_invocable should have the value 201703L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_is_layout_compatible
+# error "__cpp_lib_is_layout_compatible should be defined in c++29"
+# endif
+# if __cpp_lib_is_layout_compatible != 201907L
+# error "__cpp_lib_is_layout_compatible should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_layout_compatible
+# error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_nothrow_convertible
+# error "__cpp_lib_is_nothrow_convertible should be defined in c++29"
+# endif
+# if __cpp_lib_is_nothrow_convertible != 201806L
+# error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_null_pointer
+# error "__cpp_lib_is_null_pointer should be defined in c++29"
+# endif
+# if __cpp_lib_is_null_pointer != 201309L
+# error "__cpp_lib_is_null_pointer should have the value 201309L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_is_pointer_interconvertible
+# error "__cpp_lib_is_pointer_interconvertible should be defined in c++29"
+# endif
+# if __cpp_lib_is_pointer_interconvertible != 201907L
+# error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_pointer_interconvertible
+# error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_scoped_enum
+# error "__cpp_lib_is_scoped_enum should be defined in c++29"
+# endif
+# if __cpp_lib_is_scoped_enum != 202011L
+# error "__cpp_lib_is_scoped_enum should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_swappable
+# error "__cpp_lib_is_swappable should be defined in c++29"
+# endif
+# if __cpp_lib_is_swappable != 201603L
+# error "__cpp_lib_is_swappable should have the value 201603L in c++29"
+# endif
+
+# if __has_builtin(__builtin_is_virtual_base_of)
+# ifndef __cpp_lib_is_virtual_base_of
+# error "__cpp_lib_is_virtual_base_of should be defined in c++29"
+# endif
+# if __cpp_lib_is_virtual_base_of != 202406L
+# error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_virtual_base_of
+# error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
+# endif
+# endif
+
+# if __has_builtin(__builtin_is_within_lifetime)
+# ifndef __cpp_lib_is_within_lifetime
+# error "__cpp_lib_is_within_lifetime should be defined in c++29"
+# endif
+# if __cpp_lib_is_within_lifetime != 202306L
+# error "__cpp_lib_is_within_lifetime should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_within_lifetime
+# error "__cpp_lib_is_within_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_within_lifetime)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_logical_traits
+# error "__cpp_lib_logical_traits should be defined in c++29"
+# endif
+# if __cpp_lib_logical_traits != 201510L
+# error "__cpp_lib_logical_traits should have the value 201510L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_reference_from_temporary
+# error "__cpp_lib_reference_from_temporary should be defined in c++29"
+# endif
+# if __cpp_lib_reference_from_temporary != 202202L
+# error "__cpp_lib_reference_from_temporary should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_reference_from_temporary
+# error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_remove_cvref
+# error "__cpp_lib_remove_cvref should be defined in c++29"
+# endif
+# if __cpp_lib_remove_cvref != 201711L
+# error "__cpp_lib_remove_cvref should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_result_of_sfinae
+# error "__cpp_lib_result_of_sfinae should be defined in c++29"
+# endif
+# if __cpp_lib_result_of_sfinae != 201210L
+# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++29"
+# endif
+
+# ifndef __cpp_lib_transformation_trait_aliases
+# error "__cpp_lib_transformation_trait_aliases should be defined in c++29"
+# endif
+# if __cpp_lib_transformation_trait_aliases != 201304L
+# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_type_identity
+# error "__cpp_lib_type_identity should be defined in c++29"
+# endif
+# if __cpp_lib_type_identity != 201806L
+# error "__cpp_lib_type_identity should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_type_trait_variable_templates
+# error "__cpp_lib_type_trait_variable_templates should be defined in c++29"
+# endif
+# if __cpp_lib_type_trait_variable_templates != 201510L
+# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_void_t
+# error "__cpp_lib_void_t should be defined in c++29"
+# endif
+# if __cpp_lib_void_t != 201411L
+# error "__cpp_lib_void_t should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
index cf29080ea75b4..8d2c45c1709f6 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/typeinfo.version.compile.pass.cpp
@@ -51,7 +51,7 @@
# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constexpr_typeinfo
# error "__cpp_lib_constexpr_typeinfo should be defined in c++26"
@@ -60,6 +60,15 @@
# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constexpr_typeinfo
+# error "__cpp_lib_constexpr_typeinfo should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_typeinfo != 202106L
+# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
index 221d8aaebc14b..8d438527f1b8b 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_map.version.compile.pass.cpp
@@ -297,7 +297,7 @@
# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -387,6 +387,96 @@
# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_erasure != 202110L
+# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_insertion != 202306L
+# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_generic_unordered_lookup
+# error "__cpp_lib_generic_unordered_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_unordered_lookup != 201811L
+# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_node_extract
+# error "__cpp_lib_node_extract should be defined in c++29"
+# endif
+# if __cpp_lib_node_extract != 201606L
+# error "__cpp_lib_node_extract should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_like != 202311L
+# error "__cpp_lib_tuple_like should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_unordered_map_try_emplace
+# error "__cpp_lib_unordered_map_try_emplace should be defined in c++29"
+# endif
+# if __cpp_lib_unordered_map_try_emplace != 201411L
+# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
index d1c1335df7c80..a4f861ce9ae19 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/unordered_set.version.compile.pass.cpp
@@ -239,7 +239,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -309,6 +309,76 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_erasure != 202110L
+# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_insertion != 202306L
+# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_generic_unordered_lookup
+# error "__cpp_lib_generic_unordered_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_unordered_lookup != 201811L
+# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_node_extract
+# error "__cpp_lib_node_extract should be defined in c++29"
+# endif
+# if __cpp_lib_node_extract != 201606L
+# error "__cpp_lib_node_extract should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
index 8cbd16d242f74..bdb3deb9441a2 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp
@@ -392,7 +392,7 @@
# error "__cpp_lib_unreachable should have the value 202202L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_as_const
# error "__cpp_lib_as_const should be defined in c++26"
@@ -498,6 +498,105 @@
# error "__cpp_lib_unreachable should have the value 202202L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_as_const
+# error "__cpp_lib_as_const should be defined in c++29"
+# endif
+# if __cpp_lib_as_const != 201510L
+# error "__cpp_lib_as_const should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_algorithms
+# error "__cpp_lib_constexpr_algorithms should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_algorithms != 202306L
+# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_utility
+# error "__cpp_lib_constexpr_utility should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_utility != 201811L
+# error "__cpp_lib_constexpr_utility should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_exchange_function
+# error "__cpp_lib_exchange_function should be defined in c++29"
+# endif
+# if __cpp_lib_exchange_function != 201304L
+# error "__cpp_lib_exchange_function should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_forward_like
+# error "__cpp_lib_forward_like should be defined in c++29"
+# endif
+# if __cpp_lib_forward_like != 202207L
+# error "__cpp_lib_forward_like should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_integer_comparison_functions
+# error "__cpp_lib_integer_comparison_functions should be defined in c++29"
+# endif
+# if __cpp_lib_integer_comparison_functions != 202002L
+# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_integer_sequence
+# error "__cpp_lib_integer_sequence should be defined in c++29"
+# endif
+# if __cpp_lib_integer_sequence != 202511L
+# error "__cpp_lib_integer_sequence should have the value 202511L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_zip
+# error "__cpp_lib_ranges_zip should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_zip != 202110L
+# error "__cpp_lib_ranges_zip should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_to_underlying
+# error "__cpp_lib_to_underlying should be defined in c++29"
+# endif
+# if __cpp_lib_to_underlying != 202102L
+# error "__cpp_lib_to_underlying should have the value 202102L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_like != 202311L
+# error "__cpp_lib_tuple_like should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_tuples_by_type
+# error "__cpp_lib_tuples_by_type should be defined in c++29"
+# endif
+# if __cpp_lib_tuples_by_type != 201304L
+# error "__cpp_lib_tuples_by_type should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_unreachable
+# error "__cpp_lib_unreachable should be defined in c++29"
+# endif
+# if __cpp_lib_unreachable != 202202L
+# error "__cpp_lib_unreachable should have the value 202202L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
index ed0bb228d7701..1fa89b2a7c3f7 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/variant.version.compile.pass.cpp
@@ -97,7 +97,7 @@
# error "__cpp_lib_variant should have the value 202106L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_constrained_equality
# error "__cpp_lib_constrained_equality should be defined in c++26"
@@ -126,6 +126,35 @@
# error "__cpp_lib_variant should have the value 202306L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_variant
+# error "__cpp_lib_freestanding_variant should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_variant != 202311L
+# error "__cpp_lib_freestanding_variant should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_variant
+# error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_variant
+# error "__cpp_lib_variant should be defined in c++29"
+# endif
+# if __cpp_lib_variant != 202306L
+# error "__cpp_lib_variant should have the value 202306L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
index e34800a89c950..354a5b1fdd4db 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/vector.version.compile.pass.cpp
@@ -210,7 +210,7 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_allocator_traits_is_always_equal
# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26"
@@ -267,6 +267,63 @@
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_vector
+# error "__cpp_lib_constexpr_vector should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+# error "__cpp_lib_constexpr_vector should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_incomplete_container_elements
+# error "__cpp_lib_incomplete_container_elements should be defined in c++29"
+# endif
+# if __cpp_lib_incomplete_container_elements != 201505L
+# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 3f15dd2fd1d06..61798c57d20ff 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -300,6 +300,10 @@
# error "__cpp_lib_destroying_delete should not be defined before c++20"
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifdef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
# endif
@@ -1228,6 +1232,10 @@
# error "__cpp_lib_destroying_delete should not be defined before c++20"
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifdef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
# endif
@@ -2258,6 +2266,10 @@
# error "__cpp_lib_destroying_delete should not be defined before c++20"
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifndef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should be defined in c++17"
# endif
@@ -3561,6 +3573,10 @@
# endif
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifndef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should be defined in c++20"
# endif
@@ -5053,6 +5069,10 @@
# endif
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifndef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should be defined in c++23"
# endif
@@ -6245,7 +6265,7 @@
# error "__cpp_lib_void_t should have the value 201411L in c++23"
# endif
-#elif TEST_STD_VER > 23
+#elif TEST_STD_VER == 26
# ifndef __cpp_lib_adaptor_iterator_pair_constructor
# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26"
@@ -6809,6 +6829,10 @@
# endif
# endif
+# ifdef __cpp_lib_embed
+# error "__cpp_lib_embed should not be defined before c++29"
+# endif
+
# ifndef __cpp_lib_enable_shared_from_this
# error "__cpp_lib_enable_shared_from_this should be defined in c++26"
# endif
@@ -8259,6 +8283,2013 @@
# error "__cpp_lib_void_t should have the value 201411L in c++26"
# endif
-#endif // TEST_STD_VER > 23
+#elif TEST_STD_VER > 26
+
+# ifndef __cpp_lib_adaptor_iterator_pair_constructor
+# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++29"
+# endif
+# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L
+# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_addressof_constexpr
+# error "__cpp_lib_addressof_constexpr should be defined in c++29"
+# endif
+# if __cpp_lib_addressof_constexpr != 201603L
+# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_aligned_accessor
+# error "__cpp_lib_aligned_accessor should be defined in c++29"
+# endif
+# if __cpp_lib_aligned_accessor != 202411L
+# error "__cpp_lib_aligned_accessor should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_allocate_at_least
+# error "__cpp_lib_allocate_at_least should be defined in c++29"
+# endif
+# if __cpp_lib_allocate_at_least != 202302L
+# error "__cpp_lib_allocate_at_least should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_allocator_traits_is_always_equal
+# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++29"
+# endif
+# if __cpp_lib_allocator_traits_is_always_equal != 201411L
+# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_any
+# error "__cpp_lib_any should be defined in c++29"
+# endif
+# if __cpp_lib_any != 201606L
+# error "__cpp_lib_any should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_apply
+# error "__cpp_lib_apply should be defined in c++29"
+# endif
+# if __cpp_lib_apply != 201603L
+# error "__cpp_lib_apply should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_array_constexpr
+# error "__cpp_lib_array_constexpr should be defined in c++29"
+# endif
+# if __cpp_lib_array_constexpr != 201811L
+# error "__cpp_lib_array_constexpr should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_as_const
+# error "__cpp_lib_as_const should be defined in c++29"
+# endif
+# if __cpp_lib_as_const != 201510L
+# error "__cpp_lib_as_const should have the value 201510L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_erasure != 202110L
+# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_erasure
+# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++29"
+# endif
+# if __cpp_lib_associative_heterogeneous_insertion != 202306L
+# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_associative_heterogeneous_insertion
+# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_assume_aligned
+# error "__cpp_lib_assume_aligned should be defined in c++29"
+# endif
+# if __cpp_lib_assume_aligned != 201811L
+# error "__cpp_lib_assume_aligned should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_flag_test
+# error "__cpp_lib_atomic_flag_test should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_flag_test != 201907L
+# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_float
+# error "__cpp_lib_atomic_float should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_float != 201711L
+# error "__cpp_lib_atomic_float should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_is_always_lock_free
+# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_is_always_lock_free != 201603L
+# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_lock_free_type_aliases
+# error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_lock_free_type_aliases != 201907L
+# error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_atomic_min_max
+# error "__cpp_lib_atomic_min_max should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_min_max != 202403L
+# error "__cpp_lib_atomic_min_max should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_atomic_min_max
+# error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_atomic_ref
+# error "__cpp_lib_atomic_ref should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_ref != 202411L
+# error "__cpp_lib_atomic_ref should have the value 202411L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_atomic_shared_ptr
+# error "__cpp_lib_atomic_shared_ptr should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_shared_ptr != 201711L
+# error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_atomic_shared_ptr
+# error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_atomic_value_initialization
+# error "__cpp_lib_atomic_value_initialization should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_value_initialization != 201911L
+# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++29"
+# endif
+
+# ifndef __cpp_lib_atomic_wait
+# error "__cpp_lib_atomic_wait should be defined in c++29"
+# endif
+# if __cpp_lib_atomic_wait != 201907L
+# error "__cpp_lib_atomic_wait should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_barrier
+# error "__cpp_lib_barrier should be defined in c++29"
+# endif
+# if __cpp_lib_barrier != 201907L
+# error "__cpp_lib_barrier should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_barrier
+# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_bind_back
+# error "__cpp_lib_bind_back should be defined in c++29"
+# endif
+# if __cpp_lib_bind_back != 202202L
+# error "__cpp_lib_bind_back should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_bind_front
+# error "__cpp_lib_bind_front should be defined in c++29"
+# endif
+# if __cpp_lib_bind_front != 202306L
+# error "__cpp_lib_bind_front should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_bit_cast
+# error "__cpp_lib_bit_cast should be defined in c++29"
+# endif
+# if __cpp_lib_bit_cast != 201806L
+# error "__cpp_lib_bit_cast should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_bitops
+# error "__cpp_lib_bitops should be defined in c++29"
+# endif
+# if __cpp_lib_bitops != 201907L
+# error "__cpp_lib_bitops should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_bitset
+# error "__cpp_lib_bitset should be defined in c++29"
+# endif
+# if __cpp_lib_bitset != 202306L
+# error "__cpp_lib_bitset should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_bool_constant
+# error "__cpp_lib_bool_constant should be defined in c++29"
+# endif
+# if __cpp_lib_bool_constant != 201505L
+# error "__cpp_lib_bool_constant should have the value 201505L in c++29"
+# endif
+
+# ifndef __cpp_lib_bounded_array_traits
+# error "__cpp_lib_bounded_array_traits should be defined in c++29"
+# endif
+# if __cpp_lib_bounded_array_traits != 201902L
+# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++29"
+# endif
+
+# ifndef __cpp_lib_boyer_moore_searcher
+# error "__cpp_lib_boyer_moore_searcher should be defined in c++29"
+# endif
+# if __cpp_lib_boyer_moore_searcher != 201603L
+# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_byte
+# error "__cpp_lib_byte should be defined in c++29"
+# endif
+# if __cpp_lib_byte != 201603L
+# error "__cpp_lib_byte should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_byteswap
+# error "__cpp_lib_byteswap should be defined in c++29"
+# endif
+# if __cpp_lib_byteswap != 202110L
+# error "__cpp_lib_byteswap should have the value 202110L in c++29"
+# endif
+
+# if defined(__cpp_char8_t)
+# ifndef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should be defined in c++29"
+# endif
+# if __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_char8_t
+# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_chrono
+# error "__cpp_lib_chrono should be defined in c++29"
+# endif
+# if __cpp_lib_chrono != 201611L
+# error "__cpp_lib_chrono should have the value 201611L in c++29"
+# endif
+
+# ifndef __cpp_lib_chrono_udls
+# error "__cpp_lib_chrono_udls should be defined in c++29"
+# endif
+# if __cpp_lib_chrono_udls != 201304L
+# error "__cpp_lib_chrono_udls should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_clamp
+# error "__cpp_lib_clamp should be defined in c++29"
+# endif
+# if __cpp_lib_clamp != 201603L
+# error "__cpp_lib_clamp should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_common_reference
+# error "__cpp_lib_common_reference should be defined in c++29"
+# endif
+# if __cpp_lib_common_reference != 202302L
+# error "__cpp_lib_common_reference should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_common_reference_wrapper
+# error "__cpp_lib_common_reference_wrapper should be defined in c++29"
+# endif
+# if __cpp_lib_common_reference_wrapper != 202302L
+# error "__cpp_lib_common_reference_wrapper should have the value 202302L in c++29"
+# endif
+
+# ifndef __cpp_lib_complex_udls
+# error "__cpp_lib_complex_udls should be defined in c++29"
+# endif
+# if __cpp_lib_complex_udls != 201309L
+# error "__cpp_lib_complex_udls should have the value 201309L in c++29"
+# endif
+
+# ifndef __cpp_lib_concepts
+# error "__cpp_lib_concepts should be defined in c++29"
+# endif
+# if __cpp_lib_concepts != 202207L
+# error "__cpp_lib_concepts should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_algorithms
+# error "__cpp_lib_constexpr_algorithms should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_algorithms != 202306L
+# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_bitset
+# error "__cpp_lib_constexpr_bitset should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_bitset != 202207L
+# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_charconv
+# error "__cpp_lib_constexpr_charconv should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_charconv != 202207L
+# error "__cpp_lib_constexpr_charconv should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_cmath != 202202L
+# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_constexpr_cmath
+# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_constexpr_complex
+# error "__cpp_lib_constexpr_complex should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_complex != 201711L
+# error "__cpp_lib_constexpr_complex should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_dynamic_alloc
+# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_dynamic_alloc != 201907L
+# error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_flat_map
+# error "__cpp_lib_constexpr_flat_map should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_flat_map != 202502L
+# error "__cpp_lib_constexpr_flat_map should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_flat_set
+# error "__cpp_lib_constexpr_flat_set should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_flat_set != 202502L
+# error "__cpp_lib_constexpr_flat_set should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_forward_list
+# error "__cpp_lib_constexpr_forward_list should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_forward_list != 202502L
+# error "__cpp_lib_constexpr_forward_list should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_functional
+# error "__cpp_lib_constexpr_functional should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_functional != 201907L
+# error "__cpp_lib_constexpr_functional should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_iterator
+# error "__cpp_lib_constexpr_iterator should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_iterator != 201811L
+# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_list
+# error "__cpp_lib_constexpr_list should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_list != 202502L
+# error "__cpp_lib_constexpr_list should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_memory
+# error "__cpp_lib_constexpr_memory should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_memory != 202202L
+# error "__cpp_lib_constexpr_memory should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_ABI_VCRUNTIME)
+# ifndef __cpp_lib_constexpr_new
+# error "__cpp_lib_constexpr_new should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_new != 202406L
+# error "__cpp_lib_constexpr_new should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_constexpr_new
+# error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_constexpr_numeric
+# error "__cpp_lib_constexpr_numeric should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_numeric != 201911L
+# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_queue
+# error "__cpp_lib_constexpr_queue should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_queue != 202502L
+# error "__cpp_lib_constexpr_queue should have the value 202502L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_string
+# error "__cpp_lib_constexpr_string should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_string != 201907L
+# error "__cpp_lib_constexpr_string should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_string_view
+# error "__cpp_lib_constexpr_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_string_view != 201811L
+# error "__cpp_lib_constexpr_string_view should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_tuple
+# error "__cpp_lib_constexpr_tuple should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_tuple != 201811L
+# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_typeinfo
+# error "__cpp_lib_constexpr_typeinfo should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_typeinfo != 202106L
+# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_utility
+# error "__cpp_lib_constexpr_utility should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_utility != 201811L
+# error "__cpp_lib_constexpr_utility should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_constexpr_vector
+# error "__cpp_lib_constexpr_vector should be defined in c++29"
+# endif
+# if __cpp_lib_constexpr_vector != 201907L
+# error "__cpp_lib_constexpr_vector should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_constrained_equality
+# error "__cpp_lib_constrained_equality should be defined in c++29"
+# endif
+# if __cpp_lib_constrained_equality != 202411L
+# error "__cpp_lib_constrained_equality should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_containers_ranges
+# error "__cpp_lib_containers_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_containers_ranges != 202202L
+# error "__cpp_lib_containers_ranges should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_copyable_function
+# error "__cpp_lib_copyable_function should be defined in c++29"
+# endif
+# if __cpp_lib_copyable_function != 202306L
+# error "__cpp_lib_copyable_function should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_copyable_function
+# error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_coroutine
+# error "__cpp_lib_coroutine should be defined in c++29"
+# endif
+# if __cpp_lib_coroutine != 201902L
+# error "__cpp_lib_coroutine should have the value 201902L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_debugging
+# error "__cpp_lib_debugging should be defined in c++29"
+# endif
+# if __cpp_lib_debugging != 202311L
+# error "__cpp_lib_debugging should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_debugging
+# error "__cpp_lib_debugging should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++29"
+# endif
+# if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_default_template_type_for_algorithm_values
+# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
+# ifndef __cpp_lib_destroying_delete
+# error "__cpp_lib_destroying_delete should be defined in c++29"
+# endif
+# if __cpp_lib_destroying_delete != 201806L
+# error "__cpp_lib_destroying_delete should have the value 201806L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_destroying_delete
+# error "__cpp_lib_destroying_delete should not be defined when the requirement 'defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_embed
+# error "__cpp_lib_embed should be defined in c++29"
+# endif
+# if __cpp_lib_embed != 202606L
+# error "__cpp_lib_embed should have the value 202606L in c++29"
+# endif
+
+# ifndef __cpp_lib_enable_shared_from_this
+# error "__cpp_lib_enable_shared_from_this should be defined in c++29"
+# endif
+# if __cpp_lib_enable_shared_from_this != 201603L
+# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_endian
+# error "__cpp_lib_endian should be defined in c++29"
+# endif
+# if __cpp_lib_endian != 201907L
+# error "__cpp_lib_endian should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_erase_if
+# error "__cpp_lib_erase_if should be defined in c++29"
+# endif
+# if __cpp_lib_erase_if != 202002L
+# error "__cpp_lib_erase_if should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_exchange_function
+# error "__cpp_lib_exchange_function should be defined in c++29"
+# endif
+# if __cpp_lib_exchange_function != 201304L
+# error "__cpp_lib_exchange_function should have the value 201304L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_execution
+# error "__cpp_lib_execution should be defined in c++29"
+# endif
+# if __cpp_lib_execution != 201902L
+# error "__cpp_lib_execution should have the value 201902L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_execution
+# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_expected
+# error "__cpp_lib_expected should be defined in c++29"
+# endif
+# if __cpp_lib_expected != 202211L
+# error "__cpp_lib_expected should have the value 202211L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM
+# ifndef __cpp_lib_filesystem
+# error "__cpp_lib_filesystem should be defined in c++29"
+# endif
+# if __cpp_lib_filesystem != 201703L
+# error "__cpp_lib_filesystem should have the value 201703L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_filesystem
+# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_flat_map
+# error "__cpp_lib_flat_map should be defined in c++29"
+# endif
+# if __cpp_lib_flat_map != 202511L
+# error "__cpp_lib_flat_map should have the value 202511L in c++29"
+# endif
+
+# ifndef __cpp_lib_flat_set
+# error "__cpp_lib_flat_set should be defined in c++29"
+# endif
+# if __cpp_lib_flat_set != 202511L
+# error "__cpp_lib_flat_set should have the value 202511L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+# ifndef __cpp_lib_format
+# error "__cpp_lib_format should be defined in c++29"
+# endif
+# if __cpp_lib_format != 202110L
+# error "__cpp_lib_format should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_format
+# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_format_path
+# error "__cpp_lib_format_path should be defined in c++29"
+# endif
+# if __cpp_lib_format_path != 202403L
+# error "__cpp_lib_format_path should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_format_path
+# error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_format_ranges
+# error "__cpp_lib_format_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_format_ranges != 202207L
+# error "__cpp_lib_format_ranges should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_format_uchar
+# error "__cpp_lib_format_uchar should be defined in c++29"
+# endif
+# if __cpp_lib_format_uchar != 202311L
+# error "__cpp_lib_format_uchar should have the value 202311L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_formatters
+# error "__cpp_lib_formatters should be defined in c++29"
+# endif
+# if __cpp_lib_formatters != 202302L
+# error "__cpp_lib_formatters should have the value 202302L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_formatters
+# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_forward_like
+# error "__cpp_lib_forward_like should be defined in c++29"
+# endif
+# if __cpp_lib_forward_like != 202207L
+# error "__cpp_lib_forward_like should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_algorithm
+# error "__cpp_lib_freestanding_algorithm should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_algorithm != 202311L
+# error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_algorithm
+# error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_array
+# error "__cpp_lib_freestanding_array should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_array != 202311L
+# error "__cpp_lib_freestanding_array should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_array
+# error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_cstring
+# error "__cpp_lib_freestanding_cstring should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_cstring != 202306L
+# error "__cpp_lib_freestanding_cstring should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_cstring
+# error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_expected
+# error "__cpp_lib_freestanding_expected should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_expected != 202311L
+# error "__cpp_lib_freestanding_expected should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_expected
+# error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_mdspan
+# error "__cpp_lib_freestanding_mdspan should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_mdspan != 202311L
+# error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_mdspan
+# error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_optional
+# error "__cpp_lib_freestanding_optional should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_optional != 202311L
+# error "__cpp_lib_freestanding_optional should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_optional
+# error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_string_view
+# error "__cpp_lib_freestanding_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_string_view != 202311L
+# error "__cpp_lib_freestanding_string_view should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_string_view
+# error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_freestanding_variant
+# error "__cpp_lib_freestanding_variant should be defined in c++29"
+# endif
+# if __cpp_lib_freestanding_variant != 202311L
+# error "__cpp_lib_freestanding_variant should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_freestanding_variant
+# error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)
+# ifndef __cpp_lib_fstream_native_handle
+# error "__cpp_lib_fstream_native_handle should be defined in c++29"
+# endif
+# if __cpp_lib_fstream_native_handle != 202306L
+# error "__cpp_lib_fstream_native_handle should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_fstream_native_handle
+# error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_function_ref
+# error "__cpp_lib_function_ref should be defined in c++29"
+# endif
+# if __cpp_lib_function_ref != 202306L
+# error "__cpp_lib_function_ref should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_function_ref
+# error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_gcd_lcm
+# error "__cpp_lib_gcd_lcm should be defined in c++29"
+# endif
+# if __cpp_lib_gcd_lcm != 201606L
+# error "__cpp_lib_gcd_lcm should have the value 201606L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_generate_random
+# error "__cpp_lib_generate_random should be defined in c++29"
+# endif
+# if __cpp_lib_generate_random != 202403L
+# error "__cpp_lib_generate_random should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_generate_random
+# error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_generic_associative_lookup
+# error "__cpp_lib_generic_associative_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_associative_lookup != 201304L
+# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_generic_unordered_lookup
+# error "__cpp_lib_generic_unordered_lookup should be defined in c++29"
+# endif
+# if __cpp_lib_generic_unordered_lookup != 201811L
+# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_hardware_interference_size
+# error "__cpp_lib_hardware_interference_size should be defined in c++29"
+# endif
+# if __cpp_lib_hardware_interference_size != 201703L
+# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++29"
+# endif
+
+# ifndef __cpp_lib_has_unique_object_representations
+# error "__cpp_lib_has_unique_object_representations should be defined in c++29"
+# endif
+# if __cpp_lib_has_unique_object_representations != 201606L
+# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_hazard_pointer
+# error "__cpp_lib_hazard_pointer should be defined in c++29"
+# endif
+# if __cpp_lib_hazard_pointer != 202306L
+# error "__cpp_lib_hazard_pointer should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_hazard_pointer
+# error "__cpp_lib_hazard_pointer should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_hypot
+# error "__cpp_lib_hypot should be defined in c++29"
+# endif
+# if __cpp_lib_hypot != 201603L
+# error "__cpp_lib_hypot should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_incomplete_container_elements
+# error "__cpp_lib_incomplete_container_elements should be defined in c++29"
+# endif
+# if __cpp_lib_incomplete_container_elements != 201505L
+# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_inplace_vector
+# error "__cpp_lib_inplace_vector should be defined in c++29"
+# endif
+# if __cpp_lib_inplace_vector != 202406L
+# error "__cpp_lib_inplace_vector should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_inplace_vector
+# error "__cpp_lib_inplace_vector should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_int_pow2
+# error "__cpp_lib_int_pow2 should be defined in c++29"
+# endif
+# if __cpp_lib_int_pow2 != 202002L
+# error "__cpp_lib_int_pow2 should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_integer_comparison_functions
+# error "__cpp_lib_integer_comparison_functions should be defined in c++29"
+# endif
+# if __cpp_lib_integer_comparison_functions != 202002L
+# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_integer_sequence
+# error "__cpp_lib_integer_sequence should be defined in c++29"
+# endif
+# if __cpp_lib_integer_sequence != 202511L
+# error "__cpp_lib_integer_sequence should have the value 202511L in c++29"
+# endif
+
+# ifndef __cpp_lib_integral_constant_callable
+# error "__cpp_lib_integral_constant_callable should be defined in c++29"
+# endif
+# if __cpp_lib_integral_constant_callable != 201304L
+# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_interpolate
+# error "__cpp_lib_interpolate should be defined in c++29"
+# endif
+# if __cpp_lib_interpolate != 201902L
+# error "__cpp_lib_interpolate should have the value 201902L in c++29"
+# endif
+
+# ifndef __cpp_lib_invoke
+# error "__cpp_lib_invoke should be defined in c++29"
+# endif
+# if __cpp_lib_invoke != 201411L
+# error "__cpp_lib_invoke should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_invoke_r
+# error "__cpp_lib_invoke_r should be defined in c++29"
+# endif
+# if __cpp_lib_invoke_r != 202106L
+# error "__cpp_lib_invoke_r should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_ios_noreplace
+# error "__cpp_lib_ios_noreplace should be defined in c++29"
+# endif
+# if __cpp_lib_ios_noreplace != 202207L
+# error "__cpp_lib_ios_noreplace should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_aggregate
+# error "__cpp_lib_is_aggregate should be defined in c++29"
+# endif
+# if __cpp_lib_is_aggregate != 201703L
+# error "__cpp_lib_is_aggregate should have the value 201703L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_constant_evaluated
+# error "__cpp_lib_is_constant_evaluated should be defined in c++29"
+# endif
+# if __cpp_lib_is_constant_evaluated != 201811L
+# error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_final
+# error "__cpp_lib_is_final should be defined in c++29"
+# endif
+# if __cpp_lib_is_final != 201402L
+# error "__cpp_lib_is_final should have the value 201402L in c++29"
+# endif
+
+# if __has_builtin(__builtin_is_implicit_lifetime)
+# ifndef __cpp_lib_is_implicit_lifetime
+# error "__cpp_lib_is_implicit_lifetime should be defined in c++29"
+# endif
+# if __cpp_lib_is_implicit_lifetime != 202302L
+# error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_implicit_lifetime
+# error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_invocable
+# error "__cpp_lib_is_invocable should be defined in c++29"
+# endif
+# if __cpp_lib_is_invocable != 201703L
+# error "__cpp_lib_is_invocable should have the value 201703L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_is_layout_compatible
+# error "__cpp_lib_is_layout_compatible should be defined in c++29"
+# endif
+# if __cpp_lib_is_layout_compatible != 201907L
+# error "__cpp_lib_is_layout_compatible should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_layout_compatible
+# error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_nothrow_convertible
+# error "__cpp_lib_is_nothrow_convertible should be defined in c++29"
+# endif
+# if __cpp_lib_is_nothrow_convertible != 201806L
+# error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_null_pointer
+# error "__cpp_lib_is_null_pointer should be defined in c++29"
+# endif
+# if __cpp_lib_is_null_pointer != 201309L
+# error "__cpp_lib_is_null_pointer should have the value 201309L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_is_pointer_interconvertible
+# error "__cpp_lib_is_pointer_interconvertible should be defined in c++29"
+# endif
+# if __cpp_lib_is_pointer_interconvertible != 201907L
+# error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_pointer_interconvertible
+# error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_is_scoped_enum
+# error "__cpp_lib_is_scoped_enum should be defined in c++29"
+# endif
+# if __cpp_lib_is_scoped_enum != 202011L
+# error "__cpp_lib_is_scoped_enum should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_sufficiently_aligned
+# error "__cpp_lib_is_sufficiently_aligned should be defined in c++29"
+# endif
+# if __cpp_lib_is_sufficiently_aligned != 202411L
+# error "__cpp_lib_is_sufficiently_aligned should have the value 202411L in c++29"
+# endif
+
+# ifndef __cpp_lib_is_swappable
+# error "__cpp_lib_is_swappable should be defined in c++29"
+# endif
+# if __cpp_lib_is_swappable != 201603L
+# error "__cpp_lib_is_swappable should have the value 201603L in c++29"
+# endif
+
+# if __has_builtin(__builtin_is_virtual_base_of)
+# ifndef __cpp_lib_is_virtual_base_of
+# error "__cpp_lib_is_virtual_base_of should be defined in c++29"
+# endif
+# if __cpp_lib_is_virtual_base_of != 202406L
+# error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_virtual_base_of
+# error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!"
+# endif
+# endif
+
+# if __has_builtin(__builtin_is_within_lifetime)
+# ifndef __cpp_lib_is_within_lifetime
+# error "__cpp_lib_is_within_lifetime should be defined in c++29"
+# endif
+# if __cpp_lib_is_within_lifetime != 202306L
+# error "__cpp_lib_is_within_lifetime should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_is_within_lifetime
+# error "__cpp_lib_is_within_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_within_lifetime)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_jthread
+# error "__cpp_lib_jthread should be defined in c++29"
+# endif
+# if __cpp_lib_jthread != 201911L
+# error "__cpp_lib_jthread should have the value 201911L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_jthread
+# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_latch
+# error "__cpp_lib_latch should be defined in c++29"
+# endif
+# if __cpp_lib_latch != 201907L
+# error "__cpp_lib_latch should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_latch
+# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_launder
+# error "__cpp_lib_launder should be defined in c++29"
+# endif
+# if __cpp_lib_launder != 201606L
+# error "__cpp_lib_launder should have the value 201606L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_linalg
+# error "__cpp_lib_linalg should be defined in c++29"
+# endif
+# if __cpp_lib_linalg != 202311L
+# error "__cpp_lib_linalg should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_linalg
+# error "__cpp_lib_linalg should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_list_remove_return_type
+# error "__cpp_lib_list_remove_return_type should be defined in c++29"
+# endif
+# if __cpp_lib_list_remove_return_type != 201806L
+# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_logical_traits
+# error "__cpp_lib_logical_traits should be defined in c++29"
+# endif
+# if __cpp_lib_logical_traits != 201510L
+# error "__cpp_lib_logical_traits should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_from_tuple
+# error "__cpp_lib_make_from_tuple should be defined in c++29"
+# endif
+# if __cpp_lib_make_from_tuple != 201606L
+# error "__cpp_lib_make_from_tuple should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_reverse_iterator
+# error "__cpp_lib_make_reverse_iterator should be defined in c++29"
+# endif
+# if __cpp_lib_make_reverse_iterator != 201402L
+# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++29"
+# endif
+
+# ifndef __cpp_lib_make_unique
+# error "__cpp_lib_make_unique should be defined in c++29"
+# endif
+# if __cpp_lib_make_unique != 201304L
+# error "__cpp_lib_make_unique should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_map_try_emplace
+# error "__cpp_lib_map_try_emplace should be defined in c++29"
+# endif
+# if __cpp_lib_map_try_emplace != 201411L
+# error "__cpp_lib_map_try_emplace should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_math_constants
+# error "__cpp_lib_math_constants should be defined in c++29"
+# endif
+# if __cpp_lib_math_constants != 201907L
+# error "__cpp_lib_math_constants should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_math_special_functions
+# error "__cpp_lib_math_special_functions should be defined in c++29"
+# endif
+# if __cpp_lib_math_special_functions != 201603L
+# error "__cpp_lib_math_special_functions should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_math_special_functions
+# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_mdspan
+# error "__cpp_lib_mdspan should be defined in c++29"
+# endif
+# if __cpp_lib_mdspan != 202406L
+# error "__cpp_lib_mdspan should have the value 202406L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++29"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_modules
+# error "__cpp_lib_modules should be defined in c++29"
+# endif
+# if __cpp_lib_modules != 202207L
+# error "__cpp_lib_modules should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_move_iterator_concept
+# error "__cpp_lib_move_iterator_concept should be defined in c++29"
+# endif
+# if __cpp_lib_move_iterator_concept != 202207L
+# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_move_only_function
+# error "__cpp_lib_move_only_function should be defined in c++29"
+# endif
+# if __cpp_lib_move_only_function != 202110L
+# error "__cpp_lib_move_only_function should have the value 202110L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_move_only_function
+# error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_node_extract
+# error "__cpp_lib_node_extract should be defined in c++29"
+# endif
+# if __cpp_lib_node_extract != 201606L
+# error "__cpp_lib_node_extract should have the value 201606L in c++29"
+# endif
+
+# ifndef __cpp_lib_nonmember_container_access
+# error "__cpp_lib_nonmember_container_access should be defined in c++29"
+# endif
+# if __cpp_lib_nonmember_container_access != 201411L
+# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_not_fn
+# error "__cpp_lib_not_fn should be defined in c++29"
+# endif
+# if __cpp_lib_not_fn != 202306L
+# error "__cpp_lib_not_fn should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_null_iterators
+# error "__cpp_lib_null_iterators should be defined in c++29"
+# endif
+# if __cpp_lib_null_iterators != 201304L
+# error "__cpp_lib_null_iterators should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_optional
+# error "__cpp_lib_optional should be defined in c++29"
+# endif
+# if __cpp_lib_optional != 202506L
+# error "__cpp_lib_optional should have the value 202506L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR
+# ifndef __cpp_lib_optional_range_support
+# error "__cpp_lib_optional_range_support should be defined in c++29"
+# endif
+# if __cpp_lib_optional_range_support != 202406L
+# error "__cpp_lib_optional_range_support should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_optional_range_support
+# error "__cpp_lib_optional_range_support should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_OPTIONAL_ITERATOR' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_out_ptr
+# error "__cpp_lib_out_ptr should be defined in c++29"
+# endif
+# if __cpp_lib_out_ptr != 202311L
+# error "__cpp_lib_out_ptr should have the value 202311L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should be defined in c++29"
+# endif
+# if __cpp_lib_parallel_algorithm != 201603L
+# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_parallel_algorithm
+# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_philox_engine
+# error "__cpp_lib_philox_engine should be defined in c++29"
+# endif
+# if __cpp_lib_philox_engine != 202406L
+# error "__cpp_lib_philox_engine should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_philox_engine
+# error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++29"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
+# ifndef __cpp_lib_print
+# error "__cpp_lib_print should be defined in c++29"
+# endif
+# if __cpp_lib_print != 202207L
+# error "__cpp_lib_print should have the value 202207L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_print
+# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION
+# ifndef __cpp_lib_quoted_string_io
+# error "__cpp_lib_quoted_string_io should be defined in c++29"
+# endif
+# if __cpp_lib_quoted_string_io != 201304L
+# error "__cpp_lib_quoted_string_io should have the value 201304L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_quoted_string_io
+# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges
+# error "__cpp_lib_ranges should be defined in c++29"
+# endif
+# if __cpp_lib_ranges != 202406L
+# error "__cpp_lib_ranges should have the value 202406L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_as_const
+# error "__cpp_lib_ranges_as_const should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_as_const != 202207L
+# error "__cpp_lib_ranges_as_const should have the value 202207L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_as_const
+# error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_as_rvalue
+# error "__cpp_lib_ranges_as_rvalue should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_as_rvalue != 202207L
+# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_chunk
+# error "__cpp_lib_ranges_chunk should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_chunk != 202202L
+# error "__cpp_lib_ranges_chunk should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_chunk
+# error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_chunk_by
+# error "__cpp_lib_ranges_chunk_by should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_chunk_by != 202202L
+# error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_concat
+# error "__cpp_lib_ranges_concat should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_concat != 202403L
+# error "__cpp_lib_ranges_concat should have the value 202403L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_concat
+# error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_contains
+# error "__cpp_lib_ranges_contains should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_contains != 202207L
+# error "__cpp_lib_ranges_contains should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_find_last
+# error "__cpp_lib_ranges_find_last should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_find_last != 202207L
+# error "__cpp_lib_ranges_find_last should have the value 202207L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_indices
+# error "__cpp_lib_ranges_indices should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_indices != 202506L
+# error "__cpp_lib_ranges_indices should have the value 202506L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_iota
+# error "__cpp_lib_ranges_iota should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_iota != 202202L
+# error "__cpp_lib_ranges_iota should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_join_with
+# error "__cpp_lib_ranges_join_with should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_join_with != 202202L
+# error "__cpp_lib_ranges_join_with should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_repeat
+# error "__cpp_lib_ranges_repeat should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_repeat != 202207L
+# error "__cpp_lib_ranges_repeat should have the value 202207L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_ranges_slide
+# error "__cpp_lib_ranges_slide should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_slide != 202202L
+# error "__cpp_lib_ranges_slide should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_ranges_slide
+# error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ranges_starts_ends_with
+# error "__cpp_lib_ranges_starts_ends_with should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_starts_ends_with != 202106L
+# error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_to_container
+# error "__cpp_lib_ranges_to_container should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_to_container != 202202L
+# error "__cpp_lib_ranges_to_container should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_ranges_zip
+# error "__cpp_lib_ranges_zip should be defined in c++29"
+# endif
+# if __cpp_lib_ranges_zip != 202110L
+# error "__cpp_lib_ranges_zip should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_ratio
+# error "__cpp_lib_ratio should be defined in c++29"
+# endif
+# if __cpp_lib_ratio != 202306L
+# error "__cpp_lib_ratio should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_raw_memory_algorithms
+# error "__cpp_lib_raw_memory_algorithms should be defined in c++29"
+# endif
+# if __cpp_lib_raw_memory_algorithms != 201606L
+# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_rcu
+# error "__cpp_lib_rcu should be defined in c++29"
+# endif
+# if __cpp_lib_rcu != 202306L
+# error "__cpp_lib_rcu should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_rcu
+# error "__cpp_lib_rcu should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_reference_from_temporary
+# error "__cpp_lib_reference_from_temporary should be defined in c++29"
+# endif
+# if __cpp_lib_reference_from_temporary != 202202L
+# error "__cpp_lib_reference_from_temporary should have the value 202202L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_reference_from_temporary
+# error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_reference_wrapper
+# error "__cpp_lib_reference_wrapper should be defined in c++29"
+# endif
+# if __cpp_lib_reference_wrapper != 202403L
+# error "__cpp_lib_reference_wrapper should have the value 202403L in c++29"
+# endif
+
+# ifndef __cpp_lib_remove_cvref
+# error "__cpp_lib_remove_cvref should be defined in c++29"
+# endif
+# if __cpp_lib_remove_cvref != 201711L
+# error "__cpp_lib_remove_cvref should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_result_of_sfinae
+# error "__cpp_lib_result_of_sfinae should be defined in c++29"
+# endif
+# if __cpp_lib_result_of_sfinae != 201210L
+# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++29"
+# endif
+
+# ifndef __cpp_lib_robust_nonmodifying_seq_ops
+# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++29"
+# endif
+# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_sample
+# error "__cpp_lib_sample should be defined in c++29"
+# endif
+# if __cpp_lib_sample != 201603L
+# error "__cpp_lib_sample should have the value 201603L in c++29"
+# endif
+
+# ifndef __cpp_lib_saturation_arithmetic
+# error "__cpp_lib_saturation_arithmetic should be defined in c++29"
+# endif
+# if __cpp_lib_saturation_arithmetic != 202311L
+# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_scoped_lock
+# error "__cpp_lib_scoped_lock should be defined in c++29"
+# endif
+# if __cpp_lib_scoped_lock != 201703L
+# error "__cpp_lib_scoped_lock should have the value 201703L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_scoped_lock
+# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_semaphore
+# error "__cpp_lib_semaphore should be defined in c++29"
+# endif
+# if __cpp_lib_semaphore != 201907L
+# error "__cpp_lib_semaphore should have the value 201907L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_semaphore
+# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_senders
+# error "__cpp_lib_senders should be defined in c++29"
+# endif
+# if __cpp_lib_senders != 202406L
+# error "__cpp_lib_senders should have the value 202406L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_senders
+# error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_shared_mutex
+# error "__cpp_lib_shared_mutex should be defined in c++29"
+# endif
+# if __cpp_lib_shared_mutex != 201505L
+# error "__cpp_lib_shared_mutex should have the value 201505L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_shared_mutex
+# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_shared_ptr_arrays
+# error "__cpp_lib_shared_ptr_arrays should be defined in c++29"
+# endif
+# if __cpp_lib_shared_ptr_arrays != 201707L
+# error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++29"
+# endif
+
+# ifndef __cpp_lib_shared_ptr_weak_type
+# error "__cpp_lib_shared_ptr_weak_type should be defined in c++29"
+# endif
+# if __cpp_lib_shared_ptr_weak_type != 201606L
+# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS
+# ifndef __cpp_lib_shared_timed_mutex
+# error "__cpp_lib_shared_timed_mutex should be defined in c++29"
+# endif
+# if __cpp_lib_shared_timed_mutex != 201402L
+# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_shared_timed_mutex
+# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"
+# endif
+# endif
+
+# ifndef __cpp_lib_shift
+# error "__cpp_lib_shift should be defined in c++29"
+# endif
+# if __cpp_lib_shift != 202202L
+# error "__cpp_lib_shift should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++29"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_smart_ptr_owner_equality
+# error "__cpp_lib_smart_ptr_owner_equality should be defined in c++29"
+# endif
+# if __cpp_lib_smart_ptr_owner_equality != 202306L
+# error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_smart_ptr_owner_equality
+# error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_source_location
+# error "__cpp_lib_source_location should be defined in c++29"
+# endif
+# if __cpp_lib_source_location != 201907L
+# error "__cpp_lib_source_location should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_span
+# error "__cpp_lib_span should be defined in c++29"
+# endif
+# if __cpp_lib_span != 202002L
+# error "__cpp_lib_span should have the value 202002L in c++29"
+# endif
+
+# ifndef __cpp_lib_span_at
+# error "__cpp_lib_span_at should be defined in c++29"
+# endif
+# if __cpp_lib_span_at != 202311L
+# error "__cpp_lib_span_at should have the value 202311L in c++29"
+# endif
+
+# ifndef __cpp_lib_span_initializer_list
+# error "__cpp_lib_span_initializer_list should be defined in c++29"
+# endif
+# if __cpp_lib_span_initializer_list != 202311L
+# error "__cpp_lib_span_initializer_list should have the value 202311L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_spanstream
+# error "__cpp_lib_spanstream should be defined in c++29"
+# endif
+# if __cpp_lib_spanstream != 202106L
+# error "__cpp_lib_spanstream should have the value 202106L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_spanstream
+# error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_ssize
+# error "__cpp_lib_ssize should be defined in c++29"
+# endif
+# if __cpp_lib_ssize != 201902L
+# error "__cpp_lib_ssize should have the value 201902L in c++29"
+# endif
+
+# ifndef __cpp_lib_sstream_from_string_view
+# error "__cpp_lib_sstream_from_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_sstream_from_string_view != 202306L
+# error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_stacktrace
+# error "__cpp_lib_stacktrace should be defined in c++29"
+# endif
+# if __cpp_lib_stacktrace != 202011L
+# error "__cpp_lib_stacktrace should have the value 202011L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_stacktrace
+# error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_starts_ends_with
+# error "__cpp_lib_starts_ends_with should be defined in c++29"
+# endif
+# if __cpp_lib_starts_ends_with != 201711L
+# error "__cpp_lib_starts_ends_with should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_stdatomic_h
+# error "__cpp_lib_stdatomic_h should be defined in c++29"
+# endif
+# if __cpp_lib_stdatomic_h != 202011L
+# error "__cpp_lib_stdatomic_h should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_contains
+# error "__cpp_lib_string_contains should be defined in c++29"
+# endif
+# if __cpp_lib_string_contains != 202011L
+# error "__cpp_lib_string_contains should have the value 202011L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_resize_and_overwrite
+# error "__cpp_lib_string_resize_and_overwrite should be defined in c++29"
+# endif
+# if __cpp_lib_string_resize_and_overwrite != 202110L
+# error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_subview
+# error "__cpp_lib_string_subview should be defined in c++29"
+# endif
+# if __cpp_lib_string_subview != 202506L
+# error "__cpp_lib_string_subview should have the value 202506L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_udls
+# error "__cpp_lib_string_udls should be defined in c++29"
+# endif
+# if __cpp_lib_string_udls != 201304L
+# error "__cpp_lib_string_udls should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_string_view
+# error "__cpp_lib_string_view should be defined in c++29"
+# endif
+# if __cpp_lib_string_view != 202403L
+# error "__cpp_lib_string_view should have the value 202403L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_submdspan
+# error "__cpp_lib_submdspan should be defined in c++29"
+# endif
+# if __cpp_lib_submdspan != 202306L
+# error "__cpp_lib_submdspan should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_submdspan
+# error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
+# ifndef __cpp_lib_syncbuf
+# error "__cpp_lib_syncbuf should be defined in c++29"
+# endif
+# if __cpp_lib_syncbuf != 201803L
+# error "__cpp_lib_syncbuf should have the value 201803L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_syncbuf
+# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should be defined in c++29"
+# endif
+# if __cpp_lib_text_encoding != 202306L
+# error "__cpp_lib_text_encoding should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_three_way_comparison
+# error "__cpp_lib_three_way_comparison should be defined in c++29"
+# endif
+# if __cpp_lib_three_way_comparison != 201907L
+# error "__cpp_lib_three_way_comparison should have the value 201907L in c++29"
+# endif
+
+# ifndef __cpp_lib_to_address
+# error "__cpp_lib_to_address should be defined in c++29"
+# endif
+# if __cpp_lib_to_address != 201711L
+# error "__cpp_lib_to_address should have the value 201711L in c++29"
+# endif
+
+# ifndef __cpp_lib_to_array
+# error "__cpp_lib_to_array should be defined in c++29"
+# endif
+# if __cpp_lib_to_array != 201907L
+# error "__cpp_lib_to_array should have the value 201907L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_to_chars
+# error "__cpp_lib_to_chars should be defined in c++29"
+# endif
+# if __cpp_lib_to_chars != 202306L
+# error "__cpp_lib_to_chars should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_to_chars
+# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_to_string
+# error "__cpp_lib_to_string should be defined in c++29"
+# endif
+# if __cpp_lib_to_string != 202306L
+# error "__cpp_lib_to_string should have the value 202306L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_to_string
+# error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_to_underlying
+# error "__cpp_lib_to_underlying should be defined in c++29"
+# endif
+# if __cpp_lib_to_underlying != 202102L
+# error "__cpp_lib_to_underlying should have the value 202102L in c++29"
+# endif
+
+# ifndef __cpp_lib_transformation_trait_aliases
+# error "__cpp_lib_transformation_trait_aliases should be defined in c++29"
+# endif
+# if __cpp_lib_transformation_trait_aliases != 201304L
+# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_transparent_operators
+# error "__cpp_lib_transparent_operators should be defined in c++29"
+# endif
+# if __cpp_lib_transparent_operators != 201510L
+# error "__cpp_lib_transparent_operators should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_tuple_element_t
+# error "__cpp_lib_tuple_element_t should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_element_t != 201402L
+# error "__cpp_lib_tuple_element_t should have the value 201402L in c++29"
+# endif
+
+# if !defined(_LIBCPP_VERSION)
+# ifndef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should be defined in c++29"
+# endif
+# if __cpp_lib_tuple_like != 202311L
+# error "__cpp_lib_tuple_like should have the value 202311L in c++29"
+# endif
+# else
+# ifdef __cpp_lib_tuple_like
+# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!"
+# endif
+# endif
+
+# ifndef __cpp_lib_tuples_by_type
+# error "__cpp_lib_tuples_by_type should be defined in c++29"
+# endif
+# if __cpp_lib_tuples_by_type != 201304L
+# error "__cpp_lib_tuples_by_type should have the value 201304L in c++29"
+# endif
+
+# ifndef __cpp_lib_type_identity
+# error "__cpp_lib_type_identity should be defined in c++29"
+# endif
+# if __cpp_lib_type_identity != 201806L
+# error "__cpp_lib_type_identity should have the value 201806L in c++29"
+# endif
+
+# ifndef __cpp_lib_type_trait_variable_templates
+# error "__cpp_lib_type_trait_variable_templates should be defined in c++29"
+# endif
+# if __cpp_lib_type_trait_variable_templates != 201510L
+# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++29"
+# endif
+
+# ifndef __cpp_lib_uncaught_exceptions
+# error "__cpp_lib_uncaught_exceptions should be defined in c++29"
+# endif
+# if __cpp_lib_uncaught_exceptions != 201411L
+# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_unordered_map_try_emplace
+# error "__cpp_lib_unordered_map_try_emplace should be defined in c++29"
+# endif
+# if __cpp_lib_unordered_map_try_emplace != 201411L
+# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++29"
+# endif
+
+# ifndef __cpp_lib_unreachable
+# error "__cpp_lib_unreachable should be defined in c++29"
+# endif
+# if __cpp_lib_unreachable != 202202L
+# error "__cpp_lib_unreachable should have the value 202202L in c++29"
+# endif
+
+# ifndef __cpp_lib_unwrap_ref
+# error "__cpp_lib_unwrap_ref should be defined in c++29"
+# endif
+# if __cpp_lib_unwrap_ref != 201811L
+# error "__cpp_lib_unwrap_ref should have the value 201811L in c++29"
+# endif
+
+# ifndef __cpp_lib_variant
+# error "__cpp_lib_variant should be defined in c++29"
+# endif
+# if __cpp_lib_variant != 202306L
+# error "__cpp_lib_variant should have the value 202306L in c++29"
+# endif
+
+# ifndef __cpp_lib_void_t
+# error "__cpp_lib_void_t should be defined in c++29"
+# endif
+# if __cpp_lib_void_t != 201411L
+# error "__cpp_lib_void_t should have the value 201411L in c++29"
+# endif
+
+#endif // TEST_STD_VER > 26
// clang-format on
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 3770f026009ca..30ff46eb8d675 100644
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -514,6 +514,11 @@ def add_version_header(tc):
"test_suite_guard": "defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
"libcxx_guard": "defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L",
},
+ {
+ "name": "__cpp_lib_embed",
+ "values": {"c++29": 202606},
+ "headers": ["embed"],
+ },
{
"name": "__cpp_lib_enable_shared_from_this",
"values": {"c++17": 201603},
@@ -1559,7 +1564,7 @@ def add_version_header(tc):
def get_std_dialects():
- std_dialects = ["c++14", "c++17", "c++20", "c++23", "c++26"]
+ std_dialects = ["c++14", "c++17", "c++20", "c++23", "c++26", "c++29"]
return list(std_dialects)
>From a172190971b6d540fec812a007ebcd5f152dfb23 Mon Sep 17 00:00:00 2001
From: ThePhD <phdofthehouse at gmail.com>
Date: Fri, 1 May 2026 18:57:29 +0200
Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20apply=20clang-format?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
clang/lib/Lex/Preprocessor.cpp | 6 ++--
clang/lib/Sema/SemaChecking.cpp | 61 +++++++++++++++------------------
2 files changed, 30 insertions(+), 37 deletions(-)
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 03bc7c9474c9b..c1cce240ff0d2 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1072,8 +1072,7 @@ void Preprocessor::LexTokensUntilEOF(std::vector<Token> *Tokens) {
/// token is a '<').
/// \return \c true if we reached EOD or EOF while looking for a > token in
/// a concatenated header name and diagnosed it. \c false otherwise.
-bool Preprocessor::LexHeaderName(Token &FilenameTok,
- bool AllowMacroExpansion) {
+bool Preprocessor::LexHeaderName(Token &FilenameTok, bool AllowMacroExpansion) {
return LexHeaderNameWithExport(FilenameTok, nullptr, AllowMacroExpansion);
}
@@ -1114,8 +1113,7 @@ bool Preprocessor::LexHeaderNameWithExport(Token &FilenameTok,
*MaybeExportTok = true;
SeenExport = true;
goto header_name_start;
- }
- else {
+ } else {
*MaybeExportTok = false;
}
}
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 73dee5d145f6c..1f2b195212f97 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -6890,9 +6890,8 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
QualType LocusTy = Locus->getType();
if (!LocusTy->isIntegralOrUnscopedEnumerationType()) {
Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
- << Locus
- << "an integral type with a non-negative value"
- << Locus->getSourceRange();
+ << Locus << "an integral type with a non-negative value"
+ << Locus->getSourceRange();
return true;
}
@@ -6901,7 +6900,7 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
if ((!StatusRefTy->isIntegralOrUnscopedEnumerationType()) ||
StatusRefTy.isConstant(Context) || !StatusRef->isLValue()) {
Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
- << StatusRef << "'int&'" << StatusRef->getSourceRange();
+ << StatusRef << "'int&'" << StatusRef->getSourceRange();
return true;
}
@@ -6910,7 +6909,7 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
if ((!SizeRefTy->isIntegralOrUnscopedEnumerationType()) ||
SizeRefTy.isConstant(Context) || !SizeRef->isLValue()) {
Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
- << SizeRef << "'size_t&'" << SizeRef->getSourceRange();
+ << SizeRef << "'size_t&'" << SizeRef->getSourceRange();
return true;
}
@@ -6919,9 +6918,9 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
QualType PtrRefTy = PtrRef->getType();
if (!PtrRefTy->isPointerType() || PtrRefTy.isConstant(Context)) {
Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
- << PtrRefTy
- << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
- << PtrRef->getSourceRange();
+ << PtrRefTy
+ << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
+ << PtrRef->getSourceRange();
return true;
}
QualType ArrElementTy = PtrRefTy->getPointeeType();
@@ -6930,9 +6929,9 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
Context.getTypeAlign(ArrElementTy) == CharSize &&
ArrElementTy->isIntegralOrEnumerationType())) {
Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
- << PtrRefTy
- << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
- << PtrRef->getSourceRange();
+ << PtrRefTy
+ << "a pointer to const 'char', 'unsigned char', or 'std::byte'"
+ << PtrRef->getSourceRange();
return true;
}
@@ -6940,11 +6939,9 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
const QualType SizeType = Context.getSizeType();
QualType ResourceNameSizeTy = ResourceNameSize->getType();
if (!ResourceNameSizeTy->isIntegralOrEnumerationType()) {
- Diag(TheCall->getBeginLoc(),
- diag::err_invalid_builtin_std_embed_argument)
- << ResourceNameSizeTy
- << "an integral type with a non-negative value"
- << ResourceNameSize->getSourceRange();
+ Diag(TheCall->getBeginLoc(), diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNameSizeTy << "an integral type with a non-negative value"
+ << ResourceNameSize->getSourceRange();
return true;
}
@@ -6953,21 +6950,21 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
QualType ResourceNamePtrTy = ResourceNamePtr->getType();
if (!ResourceNamePtrTy->isPointerType()) {
Diag(ResourceNamePtr->getBeginLoc(),
- diag::err_invalid_builtin_std_embed_argument)
- << ResourceNamePtrTy
- << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
- << ResourceNamePtr->getSourceRange();
+ diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNamePtrTy
+ << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
+ << ResourceNamePtr->getSourceRange();
return true;
}
QualType ResourceNameCharTy(ResourceNamePtrTy->getPointeeOrArrayElementType(),
- 0);
+ 0);
if (!ResourceNameCharTy->isCharType() && !ResourceNameCharTy->isChar8Type() &&
!ResourceNameCharTy->isWideCharType()) {
Diag(ResourceNamePtr->getBeginLoc(),
- diag::err_invalid_builtin_std_embed_argument)
- << ResourceNamePtrTy
- << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
- << ResourceNamePtr->getSourceRange();
+ diag::err_invalid_builtin_std_embed_argument)
+ << ResourceNamePtrTy
+ << "a pointer to (possibly qualified) 'char', 'wchar_t', or 'char8_t'"
+ << ResourceNamePtr->getSourceRange();
return true;
}
@@ -6975,10 +6972,9 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
QualType OffsetTy = Offset->getType();
if (!OffsetTy->isIntegralOrEnumerationType()) {
Diag(TheCall->getBeginLoc(),
- diag::err_typecheck_converted_constant_expression)
- << OffsetTy
- << "a non-negative integer of integral type"
- << Offset->getSourceRange();
+ diag::err_typecheck_converted_constant_expression)
+ << OffsetTy << "a non-negative integer of integral type"
+ << Offset->getSourceRange();
return true;
}
@@ -6987,10 +6983,9 @@ bool Sema::BuiltinStdEmbed(CallExpr *TheCall) {
QualType LimitTy = Limit->getType();
if (!LimitTy->isIntegralOrEnumerationType()) {
Diag(TheCall->getBeginLoc(),
- diag::err_typecheck_converted_constant_expression)
- << LimitTy
- << "a non-negative integer of integral type"
- << Limit->getSourceRange();
+ diag::err_typecheck_converted_constant_expression)
+ << LimitTy << "a non-negative integer of integral type"
+ << Limit->getSourceRange();
return true;
}
}
More information about the libcxx-commits
mailing list