Commit fcde53d0 by Marc Glisse Committed by Marc Glisse

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
parent 73cc28d4
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> 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
PR c++/60765 PR c++/60765
......
...@@ -5407,7 +5407,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p, ...@@ -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 /* "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 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. */ 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 && first_initializer_p
&& d->end - d->cur == 1 && d->end - d->cur == 1
&& reference_related_p (type, TREE_TYPE (init))) && reference_related_p (type, TREE_TYPE (init)))
......
2014-04-16 Marc Glisse <marc.glisse@inria.fr>
* g++.dg/cpp0x/initlist-vect.C: New file.
2014-04-16 Eric Botcazou <ebotcazou@adacore.com> 2014-04-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/uninit-B-O0.c: Remove XFAIL. * gcc.dg/uninit-B-O0.c: Remove XFAIL.
......
// { dg-do compile { target c++11 } }
typedef float X __attribute__ ((vector_size (4 * sizeof (float))));
X x;
X x2{x};
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