https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53277
--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> --- For C++ the comment 15 case seems to have been fixed by r10-6527: 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. But it still warns when compiled as C.