Support the Standard Library Modules in C++20 mode #3977
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3945.
stl/inc/ctime
static inline
functions cannot be called when using modules" whenever_BUILD_STD_MODULE
is defined, instead of additionally guarding it with_HAS_CXX23
. This follows what<new>
is already doing to detect whether we're buildingstd.ixx
:STL/stl/inc/new
Line 20 in 60f1885
stl/inc/yvals_core.h
_BUILD_STD_MODULE
in too-old Standard modes. If they were then attempting to buildstd.ixx
, they'd be confused by the results with noexport
appearing, and if they weren't buildingstd.ixx
then I was letting them get away with something very squirrely 🐿️. Now,_EXPORT_STD
is simply directly controlled by_BUILD_STD_MODULE
, but we have enforcement that immediately rejects attempts to do this in C++17 and older.stl/modules/std.ixx
<mdspan>
,<flat_map>
,<flat_set>
,<generator>
tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp
tests/std/tests/P1502R1_standard_library_header_units/env.lst
/std:c++latest
mode because it took a while to build, and we didn't have a lot of C++23 content yet. Now we should be more disciplined and actually test it in all possible Standard modes like everything else. Although Header Units emit macros, this test machinery is shared with the Named Modules test, so I'm having the test detect the Standard mode with a dedicatedTEST_STANDARD
macro (following a different convention than the product code, to avoid confusion).tests/std/tests/P2465R3_standard_library_modules/env.lst
tests/std/include/test_header_units_and_modules.hpp
tests/std/tests/P1502R1_standard_library_header_units/test.cpp
import
s of C++23-only headers.