[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - external/libwps
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 30 05:39:29 UTC 2020
external/libwps/0001-Make-comparison-operator-member-functions-const.patch | 49 ++++++++++
external/libwps/UnpackedTarball_libwps.mk | 3
2 files changed, 52 insertions(+)
New commits:
commit a4e427deb2d168bb8e95ba0b12a0d49441854f67
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Oct 21 16:46:00 2019 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Apr 30 07:38:56 2020 +0200
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 at redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93183
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
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 at 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 f982c778a218..18e01a3cce84 100644
--- a/external/libwps/UnpackedTarball_libwps.mk
+++ b/external/libwps/UnpackedTarball_libwps.mk
@@ -15,8 +15,11 @@ $(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/0001-Make-comparison-operator-member-functions-const.patch \
))
ifneq ($(OS),MACOSX)
More information about the Libreoffice-commits
mailing list