-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting import std;
in C++20
#3945
Comments
The libstdc++ maintainers want to support I've noted this at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106852 too. |
There doesn't seem to be any technical concerns so libc++ will follow as well. We'll document it as an extension on our side around https://libcxx.llvm.org/UsingLibcxx.html#libc-extensions. |
Some basic questions:
|
No. If C++26 adds
Just the C++20 parts (with any LWG issue resolutions and C++23-and-later features that implementers have chosen to backport). This simply means that in
Mu. If you're in C++20 mode and Hopefully this all makes sense - the whole reason that the implementers view this as very easy to support is because the Standard mode is mostly orthogonal to the module mechanism (we have all made our codebases conditional on Standard mode, so selectively lighting up just the C++20 parts is trivial regardless of whether it's being done via classic headers or named modules). |
What @stl said matches what I intend to do for libc++. |
Nobody is suggesting that C++23 (e.g. |
The MSVC STL maintainers are (unsurprisingly) in favor of this too; I'll work on a PR for our repo. Thanks everyone! |
The vendors of the MSVC STL, libstdc++ and libc++ have agreed [1] to make the C++23 modules std and std.compat available in C++20. This provides the std module; libc++ has not implemented the std.compat module yet. [1] microsoft/STL#3945 Depends on D158357 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158358
The vendors of the MSVC STL, libstdc++ and libc++ have agreed [1] to make the C++23 modules std and std.compat available in C++20. This provides the std module; libc++ has not implemented the std.compat module yet. [1] microsoft/STL#3945 Depends on D158357 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158358
The vendors of the MSVC STL, libstdc++ and libc++ have agreed [1] to make the C++23 modules std and std.compat available in C++20. This provides the std module; libc++ has not implemented the std.compat module yet. [1] microsoft/STL#3945 Depends on D158357 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158358 NOKEYCHECK=True GitOrigin-RevId: b9f24033f7f2d3485fbabbc56e3b31b5bc90e874
The vendors of the MSVC STL, libstdc++ and libc++ have agreed [1] to make the C++23 modules std and std.compat available in C++20. This provides the std module; libc++ has not implemented the std.compat module yet. [1] microsoft/STL#3945 Depends on D158357 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158358
Currently, we block the C++23 Standard Library Modules from being used in C++20 mode. There's no technical reason for this, it's purely a policy choice. Supporting
import std;
in C++20 mode would be easy (remove the block, add test coverage, it'll take me just a few minutes - at least in the toolset, then we'll need to talk to the build systems), because we don't need anything from the C++23 Core Language here. However, after granting this ability to users, we can never take it back.Therefore, we're looking for cross-vendor agreement. Next Wednesday (2023-08-16), the MSVC STL maintainers will talk about this at our weekly scheduled meeting and I expect we'll agree that this is a reasonable thing to do. If the libc++ and libstdc++ maintainer teams could discuss this in their own channels and then add comments here saying "The lib<meow>c++ maintainers want to support
import std;
in C++20 mode", then we can move forward together.(This equally applies to
import std.compat;
, of course. It does not apply to any future modules that might be added to C++26 and beyond. Please note that we're not running a user survey here.)The text was updated successfully, but these errors were encountered: