2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30016
* typeck.c (build_reinterpret_cast_1): Only allow conversion to
integeral types from vectors types.
2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30016
* g++.dg/ext/vector6.C: New test.
From-SVN: r124208
+2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/30016
+ * typeck.c (build_reinterpret_cast_1): Only allow conversion to
+ integeral types from vectors types.
+
2007-04-26 Jakub Jelinek <jakub@redhat.com>
PR c++/31598
}
else if (TREE_CODE (type) == VECTOR_TYPE)
return fold_if_not_in_template (convert_to_vector (type, expr));
- else if (TREE_CODE (intype) == VECTOR_TYPE)
+ else if (TREE_CODE (intype) == VECTOR_TYPE && INTEGRAL_TYPE_P (type))
return fold_if_not_in_template (convert_to_integer (type, expr));
else
{
+2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR C++/30016
+ * g++.dg/ext/vector6.C: New test.
+
2007-04-26 Kazu Hirata <kazu@codesourcery.com>
* gcc.c-torture/execute/ieee/20000320-1.x: New.
--- /dev/null
+// { dg-options "" }
+// { dg-do compile }
+// C++/30016, we were allowing conversion between vector types
+// and union types which is invalid.
+
+typedef float __v_4F __attribute__ ((vector_size (16)));
+typedef union {__v_4F v; float a[4];} __v4F;
+void f(void)
+{
+ __v_4F b;
+ (reinterpret_cast<__v4F>(b).a)[1] = 1; // { dg-error "" }
+}