aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2014-04-16 22:46:47 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2014-04-16 20:46:47 +0000
commitfcde53d03f7c4338c4cf5a27c56606fa64b8c554 (patch)
treea9a64dd0ecdfe0cffb3307ff9932d21e61c70b20 /gcc/cp
parent73cc28d4e7afd539934e7033d0e6dea6c8265852 (diff)
downloadgcc-fcde53d03f7c4338c4cf5a27c56606fa64b8c554.zip
gcc-fcde53d03f7c4338c4cf5a27c56606fa64b8c554.tar.gz
gcc-fcde53d03f7c4338c4cf5a27c56606fa64b8c554.tar.bz2
decl.c (reshape_init_r): Handle a single element of vector type.
2014-04-16 Marc Glisse <marc.glisse@inria.fr> gcc/cp/ * decl.c (reshape_init_r): Handle a single element of vector type. gcc/testsuite/ * g++.dg/cpp0x/initlist-vect.C: New file. From-SVN: r209449
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 28c6d96..e10a227 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2014-04-16 Marc Glisse <marc.glisse@inria.fr>
+
+ * decl.c (reshape_init_r): Handle a single element of vector type.
+
2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
PR c++/60765
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f80f94a..7ce55c8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5407,7 +5407,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
/* "If T is a class type and the initializer list has a single element of
type cv U, where U is T or a class derived from T, the object is
initialized from that element." Even if T is an aggregate. */
- if (cxx_dialect >= cxx11 && CLASS_TYPE_P (type)
+ if (cxx_dialect >= cxx11 && (CLASS_TYPE_P (type) || VECTOR_TYPE_P (type))
&& first_initializer_p
&& d->end - d->cur == 1
&& reference_related_p (type, TREE_TYPE (init)))