From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 460D53877424; Wed, 23 Jun 2021 17:51:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 460D53877424 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-1757] libstdc++: Fix comment in chrono::year::is_leap() X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 8509a5001046d10fda6c9a2c0c4511f75fc8f619 X-Git-Newrev: 4a404f66b09d661bdc60e7e0d5d08f00c4e194db Message-Id: <20210623175127.460D53877424@sourceware.org> Date: Wed, 23 Jun 2021 17:51:27 +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, 23 Jun 2021 17:51:27 -0000 https://gcc.gnu.org/g:4a404f66b09d661bdc60e7e0d5d08f00c4e194db commit r12-1757-g4a404f66b09d661bdc60e7e0d5d08f00c4e194db Author: Jonathan Wakely Date: Wed Jun 23 18:50:03 2021 +0100 libstdc++: Fix comment in chrono::year::is_leap() libstdc++-v3/ChangeLog: * include/std/chrono (chrono::year::is_leap()): Fix incorrect logic in comment. Diff: --- libstdc++-v3/include/std/chrono | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index 863b6a27bdf..0b597be1944 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -1606,8 +1606,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // [1] https://github.com/cassioneri/calendar // [2] https://accu.org/journals/overload/28/155/overload155.pdf#page=16 - // Furthermore, if y%100 != 0, then y%400==0 is equivalent to y%16==0, - // so we can rearrange the expression to (mult_100 ? y % 4 : y % 16)==0 + // Furthermore, if y%100 == 0, then y%400==0 is equivalent to y%16==0, + // so we can simplify it to (!mult_100 && y % 4 == 0) || y % 16 == 0, // which is equivalent to (y & (mult_100 ? 15 : 3)) == 0. // See https://gcc.gnu.org/pipermail/libstdc++/2021-June/052815.html