This is an archive of the discontinued LLVM Phabricator instance.

[libc++][C++20 modules] Enabling in C++20.
ClosedPublic

Authored by Mordante on Aug 20 2023, 3:34 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGb9f24033f7f2: [libc++][C++20 modules] Enabling in C++20.
Summary

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] https://github.com/microsoft/STL/issues/3945

Depends on D158357

Diff Detail

Event Timeline

Mordante created this revision.Aug 20 2023, 3:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2023, 3:34 AM
Mordante updated this revision to Diff 552743.Aug 23 2023, 8:52 AM

Rebased and minor rework to match other patches.

Mordante published this revision for review.Aug 23 2023, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 12:26 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Zingam added a subscriber: Zingam.Aug 26 2023, 2:08 AM

@Mordante This is really nice. Is it landing soon? The ranges patches and maybe some others will need to be updated accordingly after this lands.

@Mordante This is really nice. Is it landing soon? The ranges patches and maybe some others will need to be updated accordingly after this lands.

I hope next week, but it depends on when it gets reviewed. If the ranges patches lands first I'll adjust this patch.

ldionne accepted this revision.Sep 5 2023, 8:45 AM
ldionne added a subscriber: ldionne.

LGTM with nits, thanks!

libcxx/docs/UsingLibcxx.rst
526–527

We should only discuss *our* implementation here. I don't think this documentation is the right place to make claims about other implementations, even though we've all agreed on this. For example, if they changed their minds, this documentation would become erroneous.

You could say something more vague like "Like other major implementations, libc++ provides C++23 modules in C++20 as an extension". Let's just not be specific.

libcxx/modules/std/vector.inc
33

IMO many of these #endif // comments are not really helpful since they are very short blocks. I find it adds clutter to the code more than anything. Non-blocking, but I would consider removing the comments for short blocks.

This revision is now accepted and ready to land.Sep 5 2023, 8:45 AM
Mordante marked 2 inline comments as done.Sep 5 2023, 9:10 AM
This revision was automatically updated to reflect the committed changes.