This is an archive of the discontinued LLVM Phabricator instance.

[C++20] Stop claiming full support for consteval (for the moment!)
ClosedPublic

Authored by aaron.ballman on Feb 22 2023, 9:45 AM.

Details

Summary

During Clang 15, 3d2629dd3aab17098813c68b5b76bb864bc5e285 claimed we achieved full support for consteval in C++20. However, further testing shows that Clang doesn't correctly handle all of the examples from https://wg21.link/P1073R3 and has several other known issues that are preventing us from defining the __cpp_consteval macro.

I think we should only claim Partial support for the moment. Once we correct the major outstanding issues, then I think we should change the status back to full support and define __cpp_consteval at the same time (even if it's only to the 201811L value instead of the latest value from C++2b). This helps users understand the support situation more clearly.

Diff Detail

Event Timeline

aaron.ballman created this revision.Feb 22 2023, 9:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 9:45 AM
aaron.ballman requested review of this revision.Feb 22 2023, 9:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 9:45 AM

We've discussed this offline, and I think this is the right thing to do, but I'll let others comment before approving.

royjacobson accepted this revision.Feb 22 2023, 12:52 PM

+1 from me, at least as long as we don't define the feature test macro.

This revision is now accepted and ready to land.Feb 22 2023, 12:52 PM

@aaron.ballman is the plan to backport that to clang 16? I think it probably should.
We ought to try to improve the situation for clang 17

@aaron.ballman is the plan to backport that to clang 16? I think it probably should.
We ought to try to improve the situation for clang 17

cxx_status.html is always updated from trunk, no? I don't think we need to bother with backporting if that's the case

@aaron.ballman is the plan to backport that to clang 16? I think it probably should.
We ought to try to improve the situation for clang 17

cxx_status.html is always updated from trunk, no? I don't think we need to bother with backporting if that's the case

Correct, that only reflects what's happening on trunk, so the only thing we could backport from this is the extra test coverage (doesn't seem worth porting, IMO).