[Bug c++/90691] [9/10 regression] -Wsign-compare false-positive with constant

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 11 08:20:00 GMT 2020


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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:dfffecb802681fbdb56629d3bdd96491ac660be0

commit r10-6572-gdfffecb802681fbdb56629d3bdd96491ac660be0
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Feb 10 14:05:06 2020 +0100

    c++: Fix static initialization from <=>.

    Constant evaluation of genericize_spaceship produced a CONSTRUCTOR, which
we
    then wanted to bind to a reference, which we can't do.  So wrap the result
    in a TARGET_EXPR so we get something with an address.

    We also need to handle treating the result of cxx_eval_binary_expression as
    a glvalue for SPACESHIP_EXPR.

    My earlier change to add uid_sensitive to maybe_constant_value was wrong;
we
    don't even look at the cache when manifestly_const_eval, and I failed to
    adjust the later call to cxx_eval_outermost_constant_expr.

    gcc/cp/ChangeLog
    2020-02-11  Jason Merrill  <jason@redhat.com>

        PR c++/93650
        PR c++/90691
        * constexpr.c (maybe_constant_value): Correct earlier change.
        (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
        * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.


More information about the Gcc-bugs mailing list