summaryrefslogtreecommitdiff
path: root/external/libwps
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-21 16:46:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-21 20:02:37 +0200
commit6fab4144b669b4896932350d090e447d50e44821 (patch)
treef1c85a09b7dd9b3c941630b1fd226de8901c0629 /external/libwps
parent00e2f118d7f4f070ebddf16b2cf4e89cf9d551a7 (diff)
external/libwps: Make comparison operator member functions const
see commit message of external/libwps/0001-Make-comparison-operator-member-functions-const.patch for details Change-Id: Ib8702f57f47aacc08628ceaccce23b487660b95c Reviewed-on: https://gerrit.libreoffice.org/81249 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external/libwps')
-rw-r--r--external/libwps/0001-Make-comparison-operator-member-functions-const.patch49
-rw-r--r--external/libwps/UnpackedTarball_libwps.mk3
2 files changed, 52 insertions, 0 deletions
diff --git a/external/libwps/0001-Make-comparison-operator-member-functions-const.patch b/external/libwps/0001-Make-comparison-operator-member-functions-const.patch
new file mode 100644
index 000000000000..c7bfb1e40aa2
--- /dev/null
+++ b/external/libwps/0001-Make-comparison-operator-member-functions-const.patch
@@ -0,0 +1,49 @@
+From 555b3e0c18ba16843541867d036da782ecdcdeb1 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman@redhat.com>
+Date: Mon, 21 Oct 2019 16:19:13 +0200
+Subject: [PATCH] Make comparison operator member functions const
+
+...which avoids overload resolution ambiguities in C++20, when a synthesized
+candidate of operator == for a reversed-argument rewrite conflicts with the
+actual operator ==, due to the asymmetric const-ness of the implicit object
+parameter and the RHS parameter. (As observed with recent Clang 10 trunk with
+-std=c++2a when building libwps as part of LibreOffice:
+
+> QuattroDosChart.cpp:399:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'WKSChart::Position' and 'WKSChart::Position')
+> if (ranges[0]!=ranges[1])
+> ~~~~~~~~~^ ~~~~~~~~~
+> ./WKSChart.h:78:8: note: candidate function
+> bool operator!=(Position &pos) const
+> ^
+> ./WKSChart.h:73:8: note: candidate function
+> bool operator==(Position &pos) const
+> ^
+> ./WKSChart.h:73:8: note: candidate function (with reversed parameter order)
+
+)
+---
+ src/lib/WKSChart.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/WKSChart.h b/src/lib/WKSChart.h
+index 268fa4a..e490357 100644
+--- a/src/lib/WKSChart.h
++++ b/src/lib/WKSChart.h
+@@ -70,12 +70,12 @@ public:
+ //! operator<<
+ friend std::ostream &operator<<(std::ostream &o, Position const &pos);
+ //! operator==
+- bool operator==(Position &pos) const
++ bool operator==(Position const &pos) const
+ {
+ return m_pos==pos.m_pos && m_sheetName==pos.m_sheetName;
+ }
+ //! operator!=
+- bool operator!=(Position &pos) const
++ bool operator!=(Position const &pos) const
+ {
+ return !(operator==(pos));
+ }
+--
+2.21.0
+
diff --git a/external/libwps/UnpackedTarball_libwps.mk b/external/libwps/UnpackedTarball_libwps.mk
index d0855de0ef99..b0d5dff309bd 100644
--- a/external/libwps/UnpackedTarball_libwps.mk
+++ b/external/libwps/UnpackedTarball_libwps.mk
@@ -15,9 +15,12 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libwps,1))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwps))
+# * external/libwps/0001-Make-comparison-operator-member-functions-const.patch is upstream at
+# <https://sourceforge.net/p/libwps/patches/6/> "Make comparison operator member functions const":
$(eval $(call gb_UnpackedTarball_add_patches,libwps,\
$(if $(SYSTEM_REVENGE),,external/libwps/rpath.patch.0) \
external/libwps/libtool.patch.0 \
+ external/libwps/0001-Make-comparison-operator-member-functions-const.patch \
))
ifneq ($(OS),MACOSX)