include/rtl/string.hxx                             |    2 +-
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 019d969d73efcb4ad876b294c968761ee8ed9733
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Oct 11 12:32:42 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Oct 11 17:08:44 2023 +0200

    The other OStringLiteral ctor should be non-explicit too
    
    It had been missed by 31cd6fd0f3c856a81a03d0229de1c4d10442844f "Make
    OStringLiteral ctor non-explicit", and now prevented u8"..."_ostr from
    compiling.
    
    Change-Id: Ifb214fba0957b0d26b11daae6190ffa9d21713f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157823
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index bb67c2f46354..a9038fc3cef0 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -109,7 +109,7 @@ public:
 #else
     constexpr
 #endif
-    explicit OStringLiteral(char8_t const (&literal)[N]) {
+    OStringLiteral(char8_t const (&literal)[N]) {
         assertLayout();
         assert(literal[N - 1] == '\0');
         //TODO: Use C++20 constexpr std::copy_n (P0202R3):
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 28755316ed8f..ef8b8f3d73c9 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -276,6 +276,7 @@ void test::ostring::StringLiterals::checkOstr() {
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ""_ostr.getLength());
     CPPUNIT_ASSERT_EQUAL(sal_Int32(6), "foobar"_ostr.getLength());
     CPPUNIT_ASSERT_EQUAL(sal_Int32(7), "foo\0bar"_ostr.getLength());
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(4), u8"\U00010000"_ostr.getLength());
     CPPUNIT_ASSERT_EQUAL(""_ostr, rtl::OString(""_tstr));
     CPPUNIT_ASSERT_EQUAL("foobar"_ostr, rtl::OString("foobar"_tstr));
     CPPUNIT_ASSERT_EQUAL("foo\0bar"_ostr, rtl::OString("foo\0bar"_tstr));

Reply via email to