From 5a40abc86b94c0be5b4a252c6ab5b0b0df6e520d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 24 Sep 2023 12:16:36 +0300 Subject: Drop some newly obsolete __cplusplus version checks ...after 1eef07805021b7ca26a1a8894809b6d995747ba1 "Bump baseline to C++20". Which revealed that at least for VS 2019 16.11.30 (but not for at least VS 2022 17.7.4), in /clr mode (e.g., when compiling cli_ure/source/climaker/climaker_app.cxx), the -std:c++20 is effectively ignored, and compilation of such source files failed with > include\rtl/string.hxx(191): error C2955: 'rtl::OStringLiteral': use of class template requires template argument list > include\rtl/string.hxx(88): note: see declaration of 'rtl::OStringLiteral' > include\rtl/string.hxx(191): error C7592: a non-type template-parameter of type 'rtl::OStringLiteral' requires at least '/std:c++20' > include\rtl/string.hxx(397): error C2955: 'rtl::OStringLiteral': use of class template requires template argument list > include\rtl/string.hxx(88): note: see declaration of 'rtl::OStringLiteral' etc. To work around that, keep the 27d1f3ac016d77d3c907cebedca558308f366855 "O[U]String literals (unusable for now, C++20 only)" functionality disabled when compiling /clr sources (i.e., where _MANAGED is defined) for that old compiler. Change-Id: If62ceef5f8e55a828b880f197111fe387e4953fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157205 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/rtl/string.hxx | 10 +++++----- include/rtl/ustring.hxx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include/rtl') diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index eb7f137a203c..72b046e26a0b 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -186,7 +186,7 @@ private: rtl_String* pData; }; -#if __cplusplus >= 202002L +#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) namespace detail { @@ -396,7 +396,7 @@ public: /// @endcond #endif -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) // For operator ""_tstr: template constexpr OString(detail::OStringHolder const & holder): pData(const_cast(&holder.literal.str)) {} @@ -472,12 +472,12 @@ public: /** Release the string data. */ -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) constexpr #endif ~OString() { -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) if (std::is_constant_evaluated()) { //TODO: We would want to // @@ -2393,7 +2393,7 @@ using ::rtl::OStringHash; using ::rtl::OStringLiteral; #endif -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) template< #if defined RTL_STRING_UNITTEST diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 34d4fd8f5be5..764ad026bdff 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -440,7 +440,7 @@ public: /// @endcond #endif -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) // For operator ""_tstr: template OUString(detail::OStringHolder const & holder) { pData = nullptr; @@ -545,12 +545,12 @@ public: /** Release the string data. */ -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) constexpr #endif ~OUString() { -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) if (std::is_constant_evaluated()) { //TODO: We would want to // @@ -3590,7 +3590,7 @@ using ::rtl::OUStringChar; using ::rtl::Concat2View; #endif -#if defined LIBO_INTERNAL_ONLY && __cplusplus >= 202002L +#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) template< #if defined RTL_STRING_UNITTEST -- cgit