This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Adds C++26 support.
ClosedPublic

Authored by Mordante on May 20 2023, 3:45 AM.

Details

Reviewers
ldionne
philnik
var-const
jloser
Group Reviewers
Restricted Project
Commits
rG00c97cbc5700: [libc++] Adds C++26 support.
Summary

Clang has been updated to support C++26, this adds the same support for
libc++. At the moment C++23 and C++26 are identical. During the next
plenary in June the first C++26 papers will be voted on.

Note like Clang this patch uses C++26 is the internal part and C++2c in
the user visible part.

Depends on D150795

Diff Detail

Event Timeline

Mordante created this revision.May 20 2023, 3:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 3:45 AM
Mordante added inline comments.May 20 2023, 3:47 AM
libcxx/utils/ci/buildkite-pipeline.yml
121–122
libcxx/utils/generate_feature_test_macro_components.py
1174

Since C++26 is the last line, it needs a to use '=' instead of '-'. This should be committed separately.

Mordante updated this revision to Diff 524019.May 20 2023, 3:58 AM

CI fixes.

Mordante updated this revision to Diff 524022.May 20 2023, 4:22 AM

CI fixes and adds missing files.

Mordante updated this revision to Diff 524025.May 20 2023, 4:55 AM

CI fixes.

Mordante updated this revision to Diff 524032.May 20 2023, 5:46 AM

Disable clang-tidy. It uses clang-16 which doesn't know C++26.

Mordante published this revision for review.May 20 2023, 7:28 AM
Mordante added reviewers: ldionne, philnik, var-const, jloser.
Mordante added inline comments.
libcxx/utils/data/ignore_format.txt
253 ↗(On Diff #524032)

Not sure why this file changed, but this makes the CI happy.

Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 7:28 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik added inline comments.May 20 2023, 8:41 AM
libcxx/utils/ci/buildkite-pipeline.yml
331–333

Why do these have to be disabled?

libcxx/utils/libcxx/test/params.py
66

Is this required, since both GCC and Clang support the c++26 flag right away?

Mordante added inline comments.
libcxx/utils/ci/buildkite-pipeline.yml
331–333

Clang 16 as used by clang-tidy-16 does not support C++23, C++2c, and C++26.

I have been considering to move to clang-tidy-17, but that gives other issues, which I'm still investigating.

libcxx/utils/libcxx/test/params.py
66

Fair point, probably not. I think we could even remove 0x, 1y. 1z, and 2a. Since we don't support that ancient compilers.

AFAIK there is no gcc yet that support C++26, but as @jwakely indicated it's expected that GCC will support C++26 and C++2c at the same time.

ldionne accepted this revision.May 23 2023, 9:01 AM
ldionne added inline comments.
libcxx/utils/data/ignore_format.txt
253 ↗(On Diff #524032)

I think this should be gone when you rebase.

libcxx/utils/libcxx/test/params.py
66

I think we should indeed remove the fallbacks here (in a separate patch). I don't think they are needed anymore, except the c++23 and c++26.

This revision is now accepted and ready to land.May 23 2023, 9:01 AM
Mordante marked 2 inline comments as done.May 23 2023, 9:47 AM
Mordante updated this revision to Diff 524772.May 23 2023, 9:48 AM

Rebased and addresses review comments.

This revision was automatically updated to reflect the committed changes.