]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix comment in chrono::year::is_leap()
authorJonathan Wakely <jwakely@redhat.com>
Wed, 23 Jun 2021 17:50:03 +0000 (18:50 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 23 Jun 2021 17:50:03 +0000 (18:50 +0100)
libstdc++-v3/ChangeLog:

* include/std/chrono (chrono::year::is_leap()): Fix incorrect
logic in comment.

libstdc++-v3/include/std/chrono

index 863b6a27bdf0c1f35b7382027b3539a2c26eb558..0b597be19447f813ac275397b376e6ad33f9c513 100644 (file)
@@ -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