summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-08-27 15:08:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-08-29 11:43:55 +0000
commitc399004b42ae3694e13730712854556b6293763e (patch)
tree7ea30d4b3fb70d4eeb674a2c60200e169be6f971
parentf37fd4e2b47c7ffe81cd76db72b012a1210c1d1b (diff)
OUString construction from OUStringLiteral1 must not be overruled by...
...Except[Const]CharArrayDetector, under RTL_STRING_UNITTEST Change-Id: Ib185fb8406c4afcff1c854a2b74dae02a0ee2b3f Reviewed-on: https://gerrit.libreoffice.org/28444 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--include/rtl/stringutils.hxx17
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx3
2 files changed, 15 insertions, 5 deletions
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx
index c794f49e4258..23cad71a00b3 100644
--- a/include/rtl/stringutils.hxx
+++ b/include/rtl/stringutils.hxx
@@ -200,6 +200,18 @@ template< int N >
struct ExceptConstCharArrayDetector< const char[ N ] >
{
};
+#if defined LIBO_INTERNAL_ONLY
+template<char C> struct ExceptConstCharArrayDetector<
+#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
+ && !defined __clang__
+ OUStringLiteral1_<C> const
+#else
+ OUStringLiteral1<C>
+#endif
+ >
+{};
+#endif
+
// this one is used to rule out only const char[N]
// (const will be brought in by 'const T&' in the function call)
// msvc needs const char[N] here (not sure whether gcc or msvc
@@ -217,9 +229,8 @@ template< int N >
struct ExceptCharArrayDetector< const char[ N ] >
{
};
-#if defined LIBO_INTERNAL_ONLY && defined _MSC_VER && _MSC_VER <= 1900
- // Visual Studio 2015
-template<char C> struct ExceptCharArrayDetector<OUStringLiteral1<C>> {};
+#if defined LIBO_INTERNAL_ONLY
+template<char C> struct ExceptCharArrayDetector<OUStringLiteral1_<C>> {};
#endif
template< typename T1, typename T2 = void >
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 961c2de72997..df9aecd4fb21 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -228,8 +228,7 @@ void test::oustring::StringLiterals::checkOUStringLiteral1()
// auto l5 = rtlunittest::OUStringLiteral1<sal_Unicode(0x100)>();
- rtl::OUString s1;
- s1 = rtlunittest::OUStringLiteral1<'A'>();
+ rtl::OUString s1{rtlunittest::OUStringLiteral1<'A'>()};
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength());
CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s1[0]);