diff options
author | Jason Merrill <jason@redhat.com> | 2022-01-26 12:44:31 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-01-26 14:27:35 -0500 |
commit | 9bf217920457f2e2d46b601f24721780a20a031b (patch) | |
tree | 02187e180ca5c291b470558cd2e72597e6e005f1 /gcc | |
parent | 866d73019bd4d1804f7e09409322e6605b81780b (diff) | |
download | gcc-9bf217920457f2e2d46b601f24721780a20a031b.zip gcc-9bf217920457f2e2d46b601f24721780a20a031b.tar.gz gcc-9bf217920457f2e2d46b601f24721780a20a031b.tar.bz2 |
c++: vector compound literal [PR104206]
My patch for PR101072 removed the specific VECTOR_TYPE handling here, which
broke pr72747-2.c on PPC; this patch restores it.
PR c++/104206
PR c++/101072
gcc/cp/ChangeLog:
* semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/semantics.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 07c2b33..466d6b5 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -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) |