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.hxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index f8b5fb461d2f..008f820bb3b1 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -521,9 +521,22 @@ public:
/**
Release the string data.
*/
+#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L
+ constexpr
+#endif
~OUString()
{
- rtl_uString_release( pData );
+#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L
+ 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.
+ } else
+#endif
+ rtl_uString_release( pData );
}
/** Provides an OUString const & passing a storage pointer of an