include/rtl/ustring.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c8eaebecd3af29c031c26142c9d3f7d7abf75b0d
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Mon Nov 7 15:11:07 2022 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue Nov 8 07:15:28 2022 +0100

    Avoid an explicit static_cast
    
    ...when shoehorning a std::size_t value into sal_Int32, to not suppress
    potential warnings from tools like 
-fsanitize=implicit-signed-integer-truncation
    and -fsanitize=implicit-integer-sign-change
    
    Change-Id: I610410f7cd69769c3721b2019e16b4c9f214ad81
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142407
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index d7d529f55e3f..16ccecedd7a9 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -163,7 +163,7 @@ public:
     /**
       make it easier to pass to OUStringBuffer and similar without 
casting/converting
     */
-    constexpr std::u16string_view asView() const { return {pData->buffer, 
static_cast<sal_uInt32>(pData->length)}; }
+    constexpr std::u16string_view asView() const { return 
std::u16string_view(pData->buffer, pData->length); }
 
     inline operator const OUString&() const;
 

Reply via email to