From: rakdver Date: Wed, 4 Jan 2006 22:46:09 +0000 (+0000) Subject: PR c++/25632 X-Git-Tag: upstream/4.9.2~56691 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07801057120a3728292fd7547db977e110163d8b;p=platform%2Fupstream%2Flinaro-gcc.git PR c++/25632 * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo in condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109354 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 + + PR c++/25632 + * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo + in condition. + 2006-01-04 Chris Lattner * 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; }