https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105569
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Candidate fix: --- a/gcc/cp/rtti.cc +++ b/gcc/cp/rtti.cc @@ -844,6 +844,9 @@ build_dynamic_cast (location_t loc, tree type, tree expr, if (r != error_mark_node) maybe_warn_about_useless_cast (loc, type, expr, complain); protected_set_expr_location (r, loc); + tree sr = r; + STRIP_TYPE_NOPS (sr); + suppress_warning (sr, OPT_Waddress); return r; }