summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-08-20 20:20:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-08-21 07:35:50 +0200
commitf0fcbcadac148a5bfd36b2a26795d45aef8eace4 (patch)
treebade826c5f4dc8148423af476b5c980a7de28837 /sal
parent7d01ce4021bafde8184355f46d1cbe2c370767e1 (diff)
Make OUStringLiteral ctor actually constexpr
...which had accidentally been broken with 87707670c993794ab12b0fad0f048f11429269c2 "Make OUStringLiteral more useful". (std::strlen unfortunately isn't constexpr, so need to use an explicit loop instead.) Change-Id: I9a820e2940b99a0c37124477810ef879d82c8325 Reviewed-on: https://gerrit.libreoffice.org/59344 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/nlsupport.cxx1
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx3
2 files changed, 4 insertions, 0 deletions
diff --git a/sal/osl/unx/nlsupport.cxx b/sal/osl/unx/nlsupport.cxx
index e1d7e393822c..c9377040894a 100644
--- a/sal/osl/unx/nlsupport.cxx
+++ b/sal/osl/unx/nlsupport.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <algorithm>
+#include <cstring>
#include <osl/nlsupport.h>
#include <osl/diagnose.h>
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 58a938ae9328..687f6b3e5146 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -41,6 +41,9 @@ private:
void testcall( const char str[] );
+ // Check that OUStringLiteral ctor is actually constexpr:
+ static constexpr rtlunittest::OUStringLiteral dummy{"dummy"};
+
CPPUNIT_TEST_SUITE(StringLiterals);
CPPUNIT_TEST(checkCtors);
CPPUNIT_TEST(checkUsage);