This is an archive of the discontinued LLVM Phabricator instance.

[libc++] [LWG3656] Update the return type of std::bit_width
ClosedPublic

Authored by Quuxplusone on Feb 23 2022, 5:20 PM.

Details

Summary

Fixes LWG3656, "Inconsistent bit operations returning a count".
https://cplusplus.github.io/LWG/issue3656

The fix has been approved for C++23 and left to vendors' discretion in C++20 (but it sounds like everyone's on the same page that of course it should be DR'ed back to C++20 too).

As usual, this PR is kinda premature because the LWG issue's resolution hasn't been formally adopted yet, so there's nothing in Cxx2bIssues.csv for it yet, but I figured I might as well prepare this PR to go in absolutely as soon as @ldionne's comfortable with it processwise. :)

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Feb 23 2022, 5:20 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptFeb 23 2022, 5:20 PM
philnik accepted this revision as: philnik.Feb 24 2022, 1:03 AM
Mordante accepted this revision as: Mordante.Feb 24 2022, 9:13 AM

From a code point of view LGTM! But since the issue hasn't been adopted yet I leave the libc++ approval to @ldionne. @ldionne do we want to change our policy regarding implementing LWG issues that haven't been approved?

@Quuxplusone can you update the status page https://libcxx.llvm.org/Status/Cxx2b.html, like we did for LWG 3645 at the bottom of the page?

ldionne accepted this revision.Mar 4 2022, 11:00 AM

LGTM, but please update the LWG issues list as suggested by @Mordante . Also, I think you can disregard the CI failure, it looks like a fluke.

This revision is now accepted and ready to land.Mar 4 2022, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 11:00 AM
This revision was landed with ongoing or failed builds.Mar 4 2022, 2:31 PM
This revision was automatically updated to reflect the committed changes.