Commit 323af7cf by Nathan Sidwell Committed by Nathan Sidwell

semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a TARGET_EXPR.

	* semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
	TARGET_EXPR.

From-SVN: r235288
parent 9023fd9e
2016-04-20 Nathan Sidwell <nathan@acm.org>
* semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
TARGET_EXPR.
2016-04-19 Jason Merrill <jason@redhat.com> 2016-04-19 Jason Merrill <jason@redhat.com>
PR c++/66543 PR c++/66543
......
...@@ -2732,8 +2732,8 @@ finish_compound_literal (tree type, tree compound_literal, ...@@ -2732,8 +2732,8 @@ finish_compound_literal (tree type, tree compound_literal,
compound_literal = digest_init (type, compound_literal, complain); compound_literal = digest_init (type, compound_literal, complain);
if (TREE_CODE (compound_literal) == CONSTRUCTOR) if (TREE_CODE (compound_literal) == CONSTRUCTOR)
TREE_HAS_CONSTRUCTOR (compound_literal) = true; 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. */ /* Put static/constant array temporaries in static variables. */
if ((!at_function_scope_p () || CP_TYPE_CONST_P (type)) if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
&& TREE_CODE (type) == ARRAY_TYPE && TREE_CODE (type) == ARRAY_TYPE
&& !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type) && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
...@@ -2763,8 +2763,13 @@ finish_compound_literal (tree type, tree compound_literal, ...@@ -2763,8 +2763,13 @@ finish_compound_literal (tree type, tree compound_literal,
return error_mark_node; return error_mark_node;
return decl; return decl;
} }
else
return get_target_expr_sfinae (compound_literal, complain); /* Represent other compound literals with TARGET_EXPR so we produce
an lvalue, but can elide copies. */
if (!VECTOR_TYPE_P (type))
compound_literal = get_target_expr_sfinae (compound_literal, complain);
return compound_literal;
} }
/* Return the declaration for the function-name variable indicated by /* Return the declaration for the function-name variable indicated by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment