Commit 0c16ddf7 by Richard Stallman

(build_c_cast): When casting to union, if value is array

or function, do default_conversion.

From-SVN: r4926
parent c8ab4464
......@@ -3854,6 +3854,10 @@ build_c_cast (type, expr)
else if (TREE_CODE (type) == UNION_TYPE)
{
tree field;
if (TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE)
value = default_conversion (value);
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)),
TYPE_MAIN_VARIANT (TREE_TYPE (value))))
......
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