Commit 57b37fe3 by Zdenek Dvorak Committed by Zdenek Dvorak

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
parent 7a6d30ce
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
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment