Skip to content
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

Implement P2417R2 More constexpr bitset #2972

Merged
merged 13 commits into from
Aug 3, 2022

Conversation

fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jul 30, 2022

Fixes #2926

I added a new test file because the previous bitset test is tr1/bitset and we don't change tr1 tests.

@fsb4000 fsb4000 requested a review from a team as a code owner July 30, 2022 13:31
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK MSVC STL tends to use conditional compile here.
It seems that _Is_constant_evaluated should only be used if old modes (C++14/17) need both constexpr and runtime optimization.

stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
@CaseyCarter CaseyCarter added the cxx23 C++23 feature label Jul 30, 2022
Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent: 1 real comment on the test, and lots of pre-existing "Hey, this could be const/noexcept" comments.

stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two tiny mistakes from my earlier suggestions, I'll just apply.

stl/inc/bitset Outdated Show resolved Hide resolved
stl/inc/bitset Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

@fsb4000 @CaseyCarter I've pushed a correctness fix and a significant expansion of test coverage; please double-check.

@strega-nil-ms strega-nil-ms self-assigned this Aug 2, 2022
@StephanTLavavej StephanTLavavej self-assigned this Aug 3, 2022
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@@ -32,41 +32,41 @@ public:
friend bitset<_Bits>;

public:
~reference() noexcept {} // TRANSITION, ABI
_CONSTEXPR23 ~reference() noexcept {} // TRANSITION, ABI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should technically be constexpr always (or I guess _CONSTEXPR20 for constexpr destructors), but since one can't create one of these at constexpr time until 23, I don't think it matters.

No change requested.

@strega-nil-ms strega-nil-ms removed their assignment Aug 3, 2022
@StephanTLavavej StephanTLavavej merged commit b8371b0 into microsoft:main Aug 3, 2022
@StephanTLavavej
Copy link
Member

Thanks for setting this bit in the C++23 conformance bitset to true! 😹 🎉 🚀

@fsb4000 fsb4000 deleted the fix2926 branch August 4, 2022 00:26
strega-nil pushed a commit to strega-nil/stl that referenced this pull request Aug 6, 2022
Co-authored-by: Daniel Marshall <[email protected]>
Co-authored-by: A. Jiang <[email protected]>
Co-authored-by: Casey Carter <[email protected]>
Co-authored-by: Stephan T. Lavavej <[email protected]>
fsb4000 added a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
Co-authored-by: Daniel Marshall <[email protected]>
Co-authored-by: A. Jiang <[email protected]>
Co-authored-by: Casey Carter <[email protected]>
Co-authored-by: Stephan T. Lavavej <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx23 C++23 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2417R2 More constexpr bitset
7 participants