diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2006-01-04 23:46:09 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2006-01-04 22:46:09 +0000 |
commit | 57b37fe381dc02993b054c441223f9c295249c6d (patch) | |
tree | bd6d5e00be1065df3fd6e7d3df2a441d292ab597 /gcc | |
parent | 7a6d30ce0d067ddd40c6d1f000c9d7de27ea4d09 (diff) | |
download | gcc-57b37fe381dc02993b054c441223f9c295249c6d.zip gcc-57b37fe381dc02993b054c441223f9c295249c6d.tar.gz gcc-57b37fe381dc02993b054c441223f9c295249c6d.tar.bz2 |
re PR c++/25632 (ICE with const int copied into two different functions)
PR c++/25632
* init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo
in condition.
From-SVN: r109354
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/init.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b2967c1..e487339 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-01-04 Zdenek Dvorak <dvorakz@suse.cz> + + PR c++/25632 + * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo + in condition. + 2006-01-04 Chris Lattner <sabre@gnu.org> * typeck2.c: update copyright to 2006 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index dbdd866..3ec5510 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1503,7 +1503,7 @@ constant_value_1 (tree decl, bool integral_p) mark_used (decl); init = DECL_INITIAL (decl); } - if (!(init || init == error_mark_node) + if (!init || init == error_mark_node || !TREE_TYPE (init) || (integral_p ? !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (init)) @@ -1516,7 +1516,7 @@ constant_value_1 (tree decl, bool integral_p) || TREE_CODE (init) == CONSTRUCTOR || TREE_CODE (init) == STRING_CST))) break; - decl = init; + decl = unshare_expr (init); } return decl; } |