* semantics.c (finish_compound_literal): Set TREE_HAS_CONSTRUCTOR.

From-SVN: r174881
This commit is contained in:
Jason Merrill 2011-06-09 23:55:33 -04:00 committed by Jason Merrill
parent 3d223145a5
commit 8c53f5e2fa
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2011-06-09 Jason Merrill <jason@redhat.com>
* semantics.c (finish_compound_literal): Set TREE_HAS_CONSTRUCTOR.
2011-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29003

View File

@ -2387,6 +2387,8 @@ finish_compound_literal (tree type, tree compound_literal,
return error_mark_node;
}
compound_literal = digest_init (type, compound_literal, complain);
if (TREE_CODE (compound_literal) == CONSTRUCTOR)
TREE_HAS_CONSTRUCTOR (compound_literal) = true;
/* Put static/constant array temporaries in static variables, but always
represent class temporaries with TARGET_EXPR so we elide copies. */
if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))