[Bug c++/90691] [9/10 regression] -Wsign-compare false-positive with constant
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Feb 8 16:17:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90691
--- Comment #7 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:aaa26bf496a646778ac861aed124d960b5bf549f
commit r10-6527-gaaa26bf496a646778ac861aed124d960b5bf549f
Author: Jason Merrill <jason@redhat.com>
Date: Sun Jan 26 22:58:32 2020 -0500
c++: Use constexpr to avoid wrong -Wsign-compare (PR90691).
We would like to do constexpr evaluation to avoid false positives on
warnings, but constexpr evaluation can involve function body copying that
changes DECL_UID, which breaks -fcompare-debug. So let's remember
that we need to avoid that.
PR c++/90691
* expr.c (fold_for_warn): Call maybe_constant_value.
* constexpr.c (struct constexpr_ctx): Add uid_sensitive field.
(maybe_constant_value): Add uid_sensitive parm.
(get_fundef_copy): Don't copy if it's true.
(cxx_eval_call_expression): Don't instantiate if it's true.
(cxx_eval_outermost_constant_expr): Likewise.
More information about the Gcc-bugs
mailing list