Commit 53b01f59 by Richard Stallman

(build_c_cast): Bypass default_conversion when casting to void.

From-SVN: r3423
parent ed3eea74
...@@ -3756,6 +3756,12 @@ build_c_cast (type, expr) ...@@ -3756,6 +3756,12 @@ build_c_cast (type, expr)
else else
{ {
tree otype; tree otype;
/* If casting to void, avoid the error that would come
from default_conversion in the case of a non-lvalue array. */
if (type == void_type_node)
return build1 (CONVERT_EXPR, type, value);
/* Convert functions and arrays to pointers, /* Convert functions and arrays to pointers,
but don't convert any other types. */ but don't convert any other types. */
if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
......
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