Skip to content

Conversation

@JonCavesMSFT
Copy link
Member

The adoption of P0960R3 (Allow initializing aggregates from a parenthesized list of values) has caused code like the following to change behavior:

#include <tuple>
struct S {
   int i;
};

std::tuple<S> t({ 1 });

This code used to be accepted but because P0960R3 changes the value of std::is_constructible_v<S, int> from false to true the compiler ends up choosing a different tuple constructor and, eventually, emits an error message:

xxx.cpp
xxx.cpp(14): error C2664: 'std::tuple<S>::tuple(std::tuple<S> &&)': cannot convert argument 1 from 'initializer list' to 'std::tuple<S> &&'
xxx.cpp(14): note: copy-list-initialization of 'std::tuple<S>' cannot use an explicit constructor

It was suggested, by Casey Carter, that I disable this test until std::tuple can be updated to handle the new C++20 rules.

@JonCavesMSFT JonCavesMSFT requested a review from a team as a code owner August 3, 2020 22:19
@StephanTLavavej StephanTLavavej added the test Related to test code label Aug 3, 2020
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Casey Carter <cartec69@gmail.com>
@StephanTLavavej StephanTLavavej self-assigned this Aug 4, 2020
@StephanTLavavej

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@StephanTLavavej

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

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

Yay, checks finally passed!

@StephanTLavavej
Copy link
Member

MSVC-PR-265344 has passed tests; when @JonCavesMSFT merges that, I'll merge this.

@CaseyCarter CaseyCarter merged commit e000d3f into microsoft:master Aug 5, 2020
@CaseyCarter
Copy link
Contributor

CaseyCarter commented Aug 5, 2020

Thanks for keeping our test suite working with MSVC! (I don't believe this change needs to be listed in our ChangeLog; shout if you disagree. I did add #1152 to track changing the SKIPPED to a FAIL when the corresponding compiler becomes the STL toolset.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Related to test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants