Skip to content

Conversation

@StephanTLavavej
Copy link
Member

_Convert_size() is an internal helper function whose sole purpose in life is to throw length_error when a size_t would be truncated to an allocator's narrower size_type (which is unusual, but there's nothing stopping an allocator from having a 32-bit size_type on a 64-bit system).

During earlier maintenance (before the GitHub era), the primary template was incorrectly marked as being unconditionally noexcept. This fixes that bug (which no users noticed), and replaces the explicit specialization for size_t with if constexpr logic.

@StephanTLavavej StephanTLavavej added the bug Something isn't working label Aug 18, 2021
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner August 18, 2021 20:41
@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 7565738 into microsoft:main Aug 27, 2021
@StephanTLavavej StephanTLavavej deleted the cleanups4-fix-convert-size-noexcept branch August 27, 2021 01:16
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.

3 participants