From 8d21c50ae1eed5866b9781ecadd78c2b60c68a45 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 21 Nov 2023 16:45:02 -0800 Subject: [PATCH] Product fix for `` calling `_Allocate_at_least_helper`. 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>(_Alloc &,unsigned int &)': cannot convert argument 2 from 'size_t' to 'unsigned int &' Elsewhere we're already using `_Mysize_type`. --- stl/inc/sstream | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stl/inc/sstream b/stl/inc/sstream index 2d38233b381..c78711c54a2 100644 --- a/stl/inc/sstream +++ b/stl/inc/sstream @@ -243,13 +243,13 @@ protected: } // grow buffer and store element - size_t _Oldsize = 0; - const auto _Oldptr = _Mysb::eback(); + _Mysize_type _Oldsize = 0; + const auto _Oldptr = _Mysb::eback(); if (_Pptr) { - _Oldsize = static_cast(_Epptr - _Oldptr); + _Oldsize = static_cast<_Mysize_type>(_Epptr - _Oldptr); } - size_t _Newsize; + _Mysize_type _Newsize; if (_Oldsize < _MINSIZE) { _Newsize = _MINSIZE; } else if (_Oldsize < INT_MAX / 2) { // grow by 50 percent