Skip to content

Conversation

miscco
Copy link
Contributor

@miscco miscco commented Jun 12, 2021

This implements the library changes in optional and variant.

That said, the tests are in a certain state that needs to be fixed. I will tackle that soon^TM

Fixes #1982

@StephanTLavavej StephanTLavavej added cxx20 C++20 feature defect report Applied retroactively labels Jun 13, 2021
@CaseyCarter

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@miscco

This comment has been minimized.

@miscco

This comment has been minimized.

@miscco miscco force-pushed the P2231-constexpr-optional branch from 16e3c24 to 9af7f80 Compare June 25, 2021 10:25
@miscco miscco force-pushed the P2231-constexpr-optional branch from 9af7f80 to d5cd6f5 Compare June 25, 2021 10:25
@miscco miscco marked this pull request as ready for review June 25, 2021 10:41
@miscco miscco requested a review from a team as a code owner June 25, 2021 10:41
@miscco
Copy link
Contributor Author

miscco commented Jun 26, 2021

As discussed in discord we are currently locked due to https://developercommunity2.visualstudio.com/t/1331017

There is no real way of working around that, so we need to wait until the fix is in

@CaseyCarter CaseyCarter added the blocked Something is preventing work on this label Jun 28, 2021
* A 64-alternative variant is "big" enough.
* Clang doesn't know yet that a union with at least one literal member is a literal type.
@CaseyCarter CaseyCarter self-requested a review August 17, 2021 22:23
#endif // TRANSITION
optional<T> copy_assigned;
assert(!copy_assigned.has_value());
copy_assigned = constructed;
Copy link
Member

Choose a reason for hiding this comment

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

I observe that constructed has been moved-from above, but the Standard guarantees that it still has_value(), and the types being tested are unchanged when they're moved-from, so this is well-defined. (Ditto for the variant tests below.) No change requested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed so that we properly use first move_constructed and then copy_assigned

@StephanTLavavej StephanTLavavej removed their assignment Aug 19, 2021
@StephanTLavavej
Copy link
Member

@miscco @CaseyCarter I pushed a conflict-free merge with main while I was in the neighborhood, followed by extending the test to cover converting construction (and updated the converting assignment tests to follow the pattern elsewhere).

@StephanTLavavej StephanTLavavej self-assigned this Aug 26, 2021
@StephanTLavavej
Copy link
Member

I'm mirroring this to an MSVC-internal PR. Please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 96a4c16 into microsoft:main Aug 26, 2021
@StephanTLavavej
Copy link
Member

Thanks for constexpring all the things! 😸 🚀 💯

@miscco miscco deleted the P2231-constexpr-optional branch August 27, 2021 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx20 C++20 feature defect report Applied retroactively
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2231R1 Completing constexpr In optional And variant
4 participants