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

<sstream>: Pass the correct size type to _Allocate_at_least_helper #4219

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

StephanTLavavej
Copy link
Member

I'm working on an llvm-project update, and it has an allocator with a custom size type that found this bug. In this PR, I'm not bothering to add any test coverage since llvm-project will provide so much.

Clang error:

sstream(263,39): error: no matching function for call to '_Allocate_at_least_helper'

MSVC error:

sstream(263): error C2664: 'wchar_t *std::_Allocate_at_least_helper<test_allocator<wchar_t>>(_Alloc &,unsigned int &)': cannot convert argument 2 from 'size_t' to 'unsigned int &'

This code was using size_t since the beginning of history, we just missed the type mismatch in #3712 / #3864.

Elsewhere we're already using _Mysize_type.

Clang:
sstream(263,39): error: no matching function for call to '_Allocate_at_least_helper'

MSVC:
sstream(263): error C2664: 'wchar_t *std::_Allocate_at_least_helper<test_allocator<wchar_t>>(_Alloc &,unsigned int &)': cannot convert argument 2 from 'size_t' to 'unsigned int &'

Elsewhere we're already using `_Mysize_type`.
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Nov 27, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner November 27, 2023 17:38
@StephanTLavavej StephanTLavavej self-assigned this Nov 29, 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 96c1e08 into microsoft:main Nov 29, 2023
37 checks passed
@StephanTLavavej StephanTLavavej deleted the alloc-at-least branch November 29, 2023 21:04
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