From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 7113D3861862; Wed, 26 Aug 2020 20:30:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7113D3861862 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598473838; bh=ta5ctMb/inLwLptLkpstZiEeLyUG8Rjdk3iEj9xZHOg=; h=From:To:Subject:Date:From; b=p3wDSemUGZjC1B1wjBkoY+CfqT8FMq2YTCYBJs8/LIdTHItj5W3REipHEqkSOUpK3 mEseLkh1a9WgierZAO4SKFZ+JY6Wfxa7sap113xvdoIDRCF1jgreGMqys2egiR/PU8 v79KWDd5K7DTZz/HPx8yShvH78XXwi2uGUt/G20s= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/c++-coroutines] libstdc++: Fix typo in chrono::year_month_weekday::operator== X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/devel/c++-coroutines X-Git-Oldrev: 9f9c0549dd42e85e2500ca67cef89dddb142c0c7 X-Git-Newrev: 0c5df67ffcf421b8c532513a655a37839e632710 Message-Id: <20200826203038.7113D3861862@sourceware.org> Date: Wed, 26 Aug 2020 20:30:38 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 20:30:38 -0000 https://gcc.gnu.org/g:0c5df67ffcf421b8c532513a655a37839e632710 commit 0c5df67ffcf421b8c532513a655a37839e632710 Author: Patrick Palka Date: Wed Aug 26 12:45:02 2020 -0400 libstdc++: Fix typo in chrono::year_month_weekday::operator== libstdc++-v3/ChangeLog: * include/std/chrono (year_month_weekday::operator==): Compare weekday_indexed instead of weekday. * testsuite/std/time/year_month_weekday/1.cc: Augment testcase. Diff: --- libstdc++-v3/include/std/chrono | 2 +- libstdc++-v3/testsuite/std/time/year_month_weekday/1.cc | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index 3cc1438a7b6..01f1e2d2b71 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -2623,7 +2623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __x.year() == __y.year() && __x.month() == __y.month() - && __x.weekday() == __y.weekday(); + && __x.weekday_indexed() == __y.weekday_indexed(); } friend constexpr year_month_weekday diff --git a/libstdc++-v3/testsuite/std/time/year_month_weekday/1.cc b/libstdc++-v3/testsuite/std/time/year_month_weekday/1.cc index 3781f1781b7..6924f947210 100644 --- a/libstdc++-v3/testsuite/std/time/year_month_weekday/1.cc +++ b/libstdc++-v3/testsuite/std/time/year_month_weekday/1.cc @@ -58,6 +58,11 @@ constexpr_year_month_weekday() static_assert(years{1} + January/Tuesday[2]/1900y == January/Tuesday[2]/1901y); static_assert(January/Tuesday[2]/1900y - years{1} == January/Tuesday[2]/1899y); + static_assert(January/Tuesday[1]/1900y != February/Tuesday[1]/1900y); + static_assert(January/Tuesday[1]/1900y != January/Wednesday[1]/1900y); + static_assert(January/Tuesday[1]/1900y != January/Tuesday[1]/1901y); + static_assert(January/Tuesday[1]/1900y != January/Tuesday[2]/1900y); + // N.B. unix seems to be a macro somewhere! constexpr ymwd myunix(local_days{days{0}}); static_assert(myunix.ok());