[pushed] c++: vector compound literal [PR104206]
Commit Message
My patch for PR101072 removed the specific VECTOR_TYPE handling here, which
broke pr72747-2.c on PPC; this patch restores it.
Tested x86_64-pc-linux-gnu, applying to trunk.
PR c++/104206
PR c++/101072
gcc/cp/ChangeLog:
* semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
---
gcc/cp/semantics.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
base-commit: 00d8321124123daf41f7c51526355a5a610cdeb8
prerequisite-patch-id: c7ab4056fcbd782232c8dc091597602ecd4a7a48
@@ -3272,8 +3272,9 @@ finish_compound_literal (tree type, tree compound_literal,
/* Represent other compound literals with TARGET_EXPR so we produce
a prvalue, and can elide copies. */
- if (TREE_CODE (compound_literal) == CONSTRUCTOR
- || TREE_CODE (compound_literal) == VEC_INIT_EXPR)
+ if (!VECTOR_TYPE_P (type)
+ && (TREE_CODE (compound_literal) == CONSTRUCTOR
+ || TREE_CODE (compound_literal) == VEC_INIT_EXPR))
{
/* The CONSTRUCTOR is now an initializer, not a compound literal. */
if (TREE_CODE (compound_literal) == CONSTRUCTOR)