[Bug c++/61614] [4.9/4.10 Regression] Bogus error: taking address of temporary array

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 26 09:57:00 GMT 2014


Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
It's r204228:

2013-10-30  Jason Merrill  <jason@redhat.com>

    * semantics.c (finish_compound_literal): Don't create a static variable
    inside cp_unevaluated_operand.

indeed, the error happens in decay_conversion in:

      if (TREE_CODE (exp) == TARGET_EXPR)
      if (complain & tf_error)
        error_at (loc, "taking address of temporary array");

where we have a TARGET_EXPR (vs a VAR_DECL).

More information about the Gcc-bugs mailing list