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

<map>, <unordered_map>: Allow MapLike<K, V&> again #3660

Merged
merged 1 commit into from Apr 20, 2023

Conversation

StephanTLavavej
Copy link
Member

One of the changes that I pushed to #2436 was damaging - while map-like types can't tolerate references as key types, using references as mapped types appears to be permitted (by the Standard, libstdc++, and libc++), and there are 4 projects across vcpkg and Real World Code that are doing this.

Fortunately, we can fix this before changes stop flowing into VS 2022 17.7 Preview 2, so users will never be affected. I'm removing my bad static_asserts, and adding test coverage to minimally verify that this scenario compiles.

(I suppose we could instead assert that the mapped types aren't function types or void types, but I'd rather just drop it entirely. Such usage is extremely unlikely and will still be rejected, just with lengthy diagnostics.)

@StephanTLavavej StephanTLavavej added bug Something isn't working high priority Important! labels Apr 18, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner April 18, 2023 19:41
@github-actions github-actions bot added this to Initial Review in Code Reviews Apr 18, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Apr 18, 2023
@barcharcraz barcharcraz moved this from Final Review to Ready To Merge in Code Reviews Apr 20, 2023
@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 0a2d59e into microsoft:main Apr 20, 2023
37 checks passed
Code Reviews automation moved this from Ready To Merge to Done Apr 20, 2023
@StephanTLavavej StephanTLavavej deleted the map-k-v-ref branch April 20, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Important!
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants