summaryrefslogtreecommitdiff
path: root/include/rtl/ustring.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/rtl/ustring.hxx')
-rw-r--r--include/rtl/ustring.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 8e8bd8e9580e..a88c2a303194 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -250,9 +250,23 @@ public:
@param str an OUString.
@since LibreOffice 5.2
*/
+#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
+ constexpr
+#endif
OUString( OUString && str ) noexcept
{
pData = str.pData;
+#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
+ if (std::is_constant_evaluated()) {
+ //TODO: We would want to
+ //
+ // assert(SAL_STRING_IS_STATIC(pData));
+ //
+ // here, but that wouldn't work because read of member `str` of OUStringLiteral's
+ // anonymous union with active member `more` is not allowed in a constant expression.
+ return;
+ }
+#endif
str.pData = nullptr;
rtl_uString_new( &str.pData );
}