+2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53761
+ * class.c (finish_struct_1): Reject aggregates decorated with
+ __transparent_union__ which cannot be made transparent because
+ the type of the first field has a different ABI from the class
+ overall.
+
2012-10-25 Jason Merrill <jason@redhat.com>
Core 1402
tree field = first_field (t);
if (field == NULL_TREE || error_operand_p (field))
{
- error ("type transparent class %qT does not have any fields", t);
+ error ("type transparent %q#T does not have any fields", t);
TYPE_TRANSPARENT_AGGR (t) = 0;
}
else if (DECL_ARTIFICIAL (field))
}
TYPE_TRANSPARENT_AGGR (t) = 0;
}
+ else if (TYPE_MODE (t) != DECL_MODE (field))
+ {
+ error ("type transparent %q#T cannot be made transparent because "
+ "the type of the first field has a different ABI from the "
+ "class overall", t);
+ TYPE_TRANSPARENT_AGGR (t) = 0;
+ }
}
}