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

Initialize array<T, 0>'s single element #3863

Merged
merged 3 commits into from
Jul 14, 2023

Conversation

CaseyCarter
Copy link
Member

... which shouldn't even be there, but can't be removed because ABI.

Fixes DevCom-10299275 / VSO-1759562 / AB#1759562.

Notably this will fail with T's that cannot be {}-initialized, e.g., types with explicit default constructors. We could work around that in C++17-and-later by initializing the array with {T()}, but I didn't want to obfuscate the code and I feel these two corner cases are incredibly unlikely to occur together.

... which shouldn't even be there, but can't be removed because ABI.

Fixes DevCom-10299275 / VSO-1759562 / AB#1759562.
@CaseyCarter CaseyCarter added the bug Something isn't working label Jul 11, 2023
@CaseyCarter CaseyCarter requested a review from a team as a code owner July 11, 2023 15:51
@StephanTLavavej StephanTLavavej self-assigned this Jul 12, 2023
@StephanTLavavej StephanTLavavej removed their assignment Jul 12, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jul 13, 2023
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit a916571 into microsoft:main Jul 14, 2023
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this notoriously annoying bug! 🐞 🛠️ ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants