diff --git a/stl/inc/__msvc_string_view.hpp b/stl/inc/__msvc_string_view.hpp index b1e27961a6a..843c640642f 100644 --- a/stl/inc/__msvc_string_view.hpp +++ b/stl/inc/__msvc_string_view.hpp @@ -665,7 +665,7 @@ class _String_bitmap { // _String_bitmap for character types } constexpr bool _Match(const _Elem _Ch) const noexcept { // test if _Ch is in the bitmap - return _Matches[static_cast(_Ch)]; + return _Matches[static_cast(_Ch)]; // lgtm [cpp/unclear-array-index-validation] } private: @@ -1331,7 +1331,7 @@ class basic_string_view { // wrapper for any kind of contiguous character buffer #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Off < _Mysize, "string_view subscript out of range"); #endif // _CONTAINER_DEBUG_LEVEL > 0 - return _Mydata[_Off]; + return _Mydata[_Off]; // lgtm [cpp/unclear-array-index-validation] } _NODISCARD constexpr const_reference at(const size_type _Off) const { diff --git a/stl/inc/charconv b/stl/inc/charconv index 666be9f0372..5dee948f3f2 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -228,7 +228,7 @@ _STL_INTERNAL_STATIC_ASSERT(_STD size(_Digit_from_byte) == 256); _NODISCARD _CONSTEXPR23 unsigned char _Digit_from_char(const char _Ch) noexcept { // convert ['0', '9'] ['A', 'Z'] ['a', 'z'] to [0, 35], everything else to 255 - return _Digit_from_byte[static_cast(_Ch)]; + return _Digit_from_byte[static_cast(_Ch)]; // lgtm [cpp/unclear-array-index-validation] } template diff --git a/stl/inc/xutility b/stl/inc/xutility index 8661e79fc21..d962c8418bd 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -4690,7 +4690,7 @@ _OutCtgIt _Copy_memmove(_CtgIt _First, _CtgIt _Last, _OutCtgIt _Dest) { const auto _Count = static_cast(_Last_ch - _First_ch); _CSTD memmove(_Dest_ch, _First_ch, _Count); if constexpr (is_pointer_v<_OutCtgIt>) { - return reinterpret_cast<_OutCtgIt>(_Dest_ch + _Count); + return reinterpret_cast<_OutCtgIt>(_Dest_ch + _Count); // lgtm [cpp/incorrect-string-type-conversion] } else { return _Dest + static_cast<_Iter_diff_t<_OutCtgIt>>(_LastPtr - _FirstPtr); } diff --git a/stl/src/StlLCMapStringA.cpp b/stl/src/StlLCMapStringA.cpp index 79cb518dc14..62305d9108f 100644 --- a/stl/src/StlLCMapStringA.cpp +++ b/stl/src/StlLCMapStringA.cpp @@ -82,10 +82,12 @@ extern "C" _CRTIMP2 int __cdecl __crtLCMapStringA(_In_opt_z_ LPCWSTR LocaleName, return retval; } + const auto wide_dest = reinterpret_cast(lpDestStr); // lgtm [cpp/incorrect-string-type-conversion] + // do string mapping if (0 - == LCMapStringEx(LocaleName, dwMapFlags, inwbuffer.get(), inbuff_size, - reinterpret_cast(lpDestStr), cchDest, nullptr, nullptr, 0)) { + == LCMapStringEx( + LocaleName, dwMapFlags, inwbuffer.get(), inbuff_size, wide_dest, cchDest, nullptr, nullptr, 0)) { return retval; } }