diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index df665d1f57f7..c2ce6e02fbed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2011-06-09 Jason Merrill + + * semantics.c (finish_compound_literal): Set TREE_HAS_CONSTRUCTOR. + 2011-06-09 Paolo Carlini PR c++/29003 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 53e599305baa..bf6486be6444 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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))