diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-04-04 22:51:02 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-04-04 22:51:02 +0000 |
commit | 644809883ad9a6cbd573001b3a5f5fdc3dfbe237 (patch) | |
tree | d8264309dc2c46a391392670e32318186e13e6c0 /gcc/varasm.c | |
parent | aaf3c6d91d8d9013234d58100c23c2f78249cf3c (diff) | |
download | gcc-644809883ad9a6cbd573001b3a5f5fdc3dfbe237.zip gcc-644809883ad9a6cbd573001b3a5f5fdc3dfbe237.tar.gz gcc-644809883ad9a6cbd573001b3a5f5fdc3dfbe237.tar.bz2 |
re PR c++/14804 ([unit-at-a-time] initializing const data with reinterpret_cast-ed pointer-to-member function crashes)
PR c++/14804
* varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to
RECORD_TYPEs.
From-SVN: r80404
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |