Commit 0465369f by Jason Merrill Committed by Jason Merrill

re PR bootstrap/68346 (Bootstrap failure on i686-linux)

	PR bootstrap/68346

	* typeck.c (build_static_cast_1): Force a NOP when converting to
	the same type.

From-SVN: r230508
parent f26a415e
2015-11-17 Jason Merrill <jason@redhat.com>
PR bootstrap/68346
* typeck.c (build_static_cast_1): Force a NOP when converting to
the same type.
* cp-tree.h (LITERAL_ZERO_P): Remove.
* parser.c (cp_parser_postfix_expression, literal_zeros)
(cp_parser_parenthesized_expression_list): Don't mess with it.
......
......@@ -6668,7 +6668,13 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
If T is a reference type, the result is an lvalue; otherwise,
the result is an rvalue. */
if (TREE_CODE (type) != REFERENCE_TYPE)
result = rvalue (result);
{
result = rvalue (result);
if (result == expr && SCALAR_TYPE_P (type))
/* Leave some record of the cast. */
result = build_nop (type, expr);
}
return result;
}
......
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