[Bug c++/92106] [8/9/10 Regression] ICE with structured bindings and -Wreturn-local-addr

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Oct 15 16:38:00 GMT 2019


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #4)
> +     tree init;
> +     if (TYPE_REF_P (TREE_TYPE (base))
> +         && (init = DECL_INITIAL (base)))
> +       return maybe_warn_about_returning_address_of_local (init);

Then please use
      if (TYPE_REF_P (TREE_TYPE (base))
        if (tree init = DECL_INITIAL (base))
          return ...;
instead.


More information about the Gcc-bugs mailing list