-
Notifications
You must be signed in to change notification settings - Fork 1.6k
P2231 Completing constexpr in optional and variant #2005
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
P2231 Completing constexpr in optional and variant #2005
Conversation
tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Casey Carter <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
16e3c24
to
9af7f80
Compare
9af7f80
to
d5cd6f5
Compare
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 |
* 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.
tests/std/tests/P2231R1_complete_constexpr_optional_variant/test.cpp
Outdated
Show resolved
Hide resolved
…st.cpp Add missing include
#endif // TRANSITION | ||
optional<T> copy_assigned; | ||
assert(!copy_assigned.has_value()); | ||
copy_assigned = constructed; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@miscco @CaseyCarter I pushed a conflict-free merge with |
tests/std/tests/P2231R1_complete_constexpr_optional_variant/test.cpp
Outdated
Show resolved
Hide resolved
tests/std/tests/P2231R1_complete_constexpr_optional_variant/test.cpp
Outdated
Show resolved
Hide resolved
I'm mirroring this to an MSVC-internal PR. Please notify me if any further changes are pushed. |
Thanks for |
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