https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103480
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|-Werror=useless-cast with |[10/11/12 Regression] |constexpr destructor |-Werror=useless-cast with | |constexpr destructor Target Milestone|--- |10.4 Priority|P3 |P2 --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Started with r10-6527: commit aaa26bf496a646778ac861aed124d960b5bf549f Author: Jason Merrill <ja...@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.