From ea3373cd2d2da9752daf0679351945a3b49fd6ee Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 25 Aug 1994 11:30:29 -0400 Subject: [PATCH] (type_lists_compatible_p): Treat transparent unions just like unnamed ones. From-SVN: r7979 --- gcc/c-typeck.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index bb638dc7c25..d828ce7bdaf 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -655,7 +655,8 @@ type_lists_compatible_p (args1, args2) /* Allow wait (union {union wait *u; int *i} *) and wait (union wait *) to be compatible. */ if (TREE_CODE (TREE_VALUE (args1)) == UNION_TYPE - && TYPE_NAME (TREE_VALUE (args1)) == 0 + && (TYPE_NAME (TREE_VALUE (args1)) == 0 + || TYPE_TRANSPARENT_UNION (TREE_VALUE (args1))) && TREE_CODE (TYPE_SIZE (TREE_VALUE (args1))) == INTEGER_CST && tree_int_cst_equal (TYPE_SIZE (TREE_VALUE (args1)), TYPE_SIZE (TREE_VALUE (args2)))) @@ -669,7 +670,8 @@ type_lists_compatible_p (args1, args2) return 0; } else if (TREE_CODE (TREE_VALUE (args2)) == UNION_TYPE - && TYPE_NAME (TREE_VALUE (args2)) == 0 + && (TYPE_NAME (TREE_VALUE (args2)) == 0 + || TYPE_TRANSPARENT_UNION (TREE_VALUE (args2))) && TREE_CODE (TYPE_SIZE (TREE_VALUE (args2))) == INTEGER_CST && tree_int_cst_equal (TYPE_SIZE (TREE_VALUE (args2)), TYPE_SIZE (TREE_VALUE (args1)))) -- 2.30.2