aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/varasm.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4bdea47..582add2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2004-04-04 Mark Mitchell <mark@codesourcery.com>
+ PR c++/14804
+ * varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to
+ RECORD_TYPEs.
+
+2004-04-04 Mark Mitchell <mark@codesourcery.com>
+
* doc/invoke.texi (-mabi=o64): Create link to O64 ABI
documentation.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index a518dd7..707ad4b 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3332,8 +3332,10 @@ initializer_constant_valid_p (tree value, tree endtype)
endtype);
}
- /* Allow conversions to union types if the value inside is okay. */
- if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)
+ /* Allow conversions to struct or union types if the value
+ inside is okay. */
+ if (TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE
+ || TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)
return initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
break;