https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100903

--- Comment #22 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jason Merrill
<[email protected]>:

https://gcc.gnu.org/g:882ec218ac1330cfada7266a1df06f626a2c0781

commit r16-8899-g882ec218ac1330cfada7266a1df06f626a2c0781
Author: Jason Merrill <[email protected]>
Date:   Tue May 12 15:25:29 2026 -0400

    c++: -Wzero-as-null-pointer-constant and <=> [PR100903]

    (x <=> y) < 0 is the pattern suggested by the standard, we shouldn't warn
    about it because of our implementation strategy.

    We already disable the warning in <compare> to avoid warnings on the uses
of
    this pattern within the header, so no library changes are needed.

            PR c++/100903

    gcc/cp/ChangeLog:

            * call.cc (build_over_call): Avoid -Wzero-as-null-pointer-constant
            if the warning is disabled around the called function.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/spaceship-warn1.C: New test.

    (cherry picked from commit 03bf757085091d95a9fe4ab964ee62da157ef563)

Reply via email to