summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-09-24 12:16:36 +0300
committerStephan Bergmann <sbergman@redhat.com>2023-09-29 16:45:08 +0200
commit5a40abc86b94c0be5b4a252c6ab5b0b0df6e520d (patch)
treef8aeac628b0b3629faa21c4787885a0166520d39 /include
parentef5cb6cdcd50942aea56ffb322bc89a4c7069bc6 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/rtl/string.hxx10
-rw-r--r--include/rtl/ustring.hxx8
-rw-r--r--include/unotools/weakref.hxx2
3 files changed, 10 insertions, 10 deletions
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<OStringLiteral L> constexpr OString(detail::OStringHolder<L> const & holder):
pData(const_cast<rtl_String *>(&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<OStringLiteral L> OUString(detail::OStringHolder<L> 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
diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index 14ee6d424f62..0cab7d0e9b2a 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -115,7 +115,7 @@ public:
@return hard reference or null, if the weakly referenced interface has gone
*/
rtl::Reference<interface_type> SAL_CALL get() const
-#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ <= 15)
+#if !(defined __clang__ && __clang_major__ <= 15)
requires(!cppu::detail::isUnoInterfaceType<interface_type>)
#endif
{