aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-convert.c')
-rw-r--r--gcc/c-convert.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 20d2e466fe3..39eb63ecd4e 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -33,6 +33,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "flags.h"
#include "convert.h"
#include "c-common.h"
+/* APPLE LOCAL begin IMA aggregate types */
+#include "c-tree.h"
+/* APPLE LOCAL end IMA aggregate types */
#include "langhooks.h"
#include "toplev.h"
@@ -114,6 +117,15 @@ convert (tree type, tree expr)
return fold (convert_to_complex (type, e));
if (code == VECTOR_TYPE)
return fold (convert_to_vector (type, e));
+ /* APPLE LOCAL begin IMA aggregate types */
+ if (code == RECORD_TYPE || code == ENUMERAL_TYPE || code == UNION_TYPE)
+ {
+ tree t2 = TREE_TYPE (expr);
+ if (code == TREE_CODE (t2)
+ && !same_translation_unit_p (type, t2) && tagged_types_tu_compatible_p (type, t2, 0))
+ return e;
+ }
+ /* APPLE LOCAL end IMA aggregate types */
error ("conversion to non-scalar type requested");
return error_mark_node;