From 15390d75ee6ca429dbbe15ea04214df8a30fbd48 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 21 Oct 2019 17:54:18 +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 firebird as part of LibreOffice: > workdir/UnpackedTarball/firebird/src/jrd/inf.cpp:1139:62: error: use of overloaded operator '!=' is ambiguous (with operand types 'RuntimeStatistics::Iterator' and 'Jrd::RuntimeStatistics::Iterator') > for (RuntimeStatistics::Iterator iter = stats.begin(); iter != stats.end(); ++iter) > ~~~~ ^ ~~~~~~~~~~~ > workdir/UnpackedTarball/firebird/src/jrd/../dsql/../jrd/RuntimeStatistics.h:283:8: note: candidate function > bool operator!=(const Iterator& other) > ^ > workdir/UnpackedTarball/firebird/src/jrd/../dsql/../jrd/RuntimeStatistics.h:278:8: note: candidate function > bool operator==(const Iterator& other) > ^ > workdir/UnpackedTarball/firebird/src/jrd/../dsql/../jrd/RuntimeStatistics.h:278:8: note: candidate function (with reversed parameter order) ) --- src/jrd/RuntimeStatistics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jrd/RuntimeStatistics.h b/src/jrd/RuntimeStatistics.h index 74a03de2ad..fab286ad1a 100644 --- a/src/jrd/RuntimeStatistics.h +++ b/src/jrd/RuntimeStatistics.h @@ -290,12 +290,12 @@ public: {} public: - bool operator==(const Iterator& other) + bool operator==(const Iterator& other) const { return (m_counts == other.m_counts); } - bool operator!=(const Iterator& other) + bool operator!=(const Iterator& other) const { return (m_counts != other.m_counts); } -- 2.21.0 tion value='distro/collabora/cd-5.3-3.2'>distro/collabora/cd-5.3-3.2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/scaddins
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2018-12-09 11:52:18 +0100
committerEike Rathke <erack@redhat.com>2018-12-12 15:58:53 +0100
commit22be500b1624753decec43c0de4ccb1c5f7a21d4 (patch)
tree1436d6e8988b0a951f496a508b7d418239a84694 /scaddins
parent12edea426a31f57a9d5b1c65b34fb1336c5534e9 (diff)
tdf#69569 implement proposed change to ODF1.2 part 2 §4.11.7.7
Calculating the number of days in a year in AddIn function GetDaysInYear() for basis 1 (actual/actual) gave wrong results. Now the results are correct and the same as in Excel. Extended the unit test document for function YEARFRAC and corrected the unit test document for function AMORDEGRC (verified the results with Excel). Change-Id: Ic68f108496f41dec71b3616095dff80512a64c31 Reviewed-on: https://gerrit.libreoffice.org/64837 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>