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

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

https://gcc.gnu.org/g:430d39d890d1828b33781724b76eef421885deb5

commit r16-8478-g430d39d890d1828b33781724b76eef421885deb5
Author: Eczbek <[email protected]>
Date:   Mon Apr 6 11:15:02 2026 -0400

    c++: Fix unary negation of nullptr [PR123087]

    [expr.unary.op] paragraph 9 says that the operand is
    contextually converted to bool, so this should be legal.

            PR c++/123087

    gcc/cp/ChangeLog:

            * typeck.cc (cp_build_unary_op): For TRUTH_NOT_EXPR, replace
            call to perform_implicit_conversion with call to
            contextual_conv_bool.

    gcc/testsuite/ChangeLog:

            * g++.dg/DRs/dr1423.C: Additonal test.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to