PR c/35748
* c-typeck.c (build_c_cast): Skip invalid fields in unions.
* gcc.dg/union-cast-4.c: New test.
From-SVN: r133737
+2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c/35748
+ * c-typeck.c (build_c_cast): Skip invalid fields in unions.
+
2008-03-30 H.J. Lu <hongjiu.lu@intel.com>
PR target/35757
tree field;
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)),
- TYPE_MAIN_VARIANT (TREE_TYPE (value))))
+ if (TREE_TYPE (field) != error_mark_node
+ && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)),
+ TYPE_MAIN_VARIANT (TREE_TYPE (value))))
break;
if (field)
+2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c/35748
+ * gcc.dg/union-cast-4.c: New test.
+
2008-03-30 H.J. Lu <hongjiu.lu@intel.com>
PR target/35757
--- /dev/null
+/* PR c/35748 */
+
+union U { void x[1]; }; /* { dg-error "array of voids" } */
+
+void foo()
+{
+ (union U)0; /* { dg-error "type not present" } */
+}