Commit c2840dfb by Jason Merrill Committed by Jason Merrill

typeck.c (build_const_cast): Handle references here instead of handing off to convert_to_reference.

	* typeck.c (build_const_cast): Handle references here instead of
	handing off to convert_to_reference.

From-SVN: r16810
parent fb98cff6
Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com> Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (build_const_cast): Handle references here instead of
handing off to convert_to_reference.
* except.c: Lose Unexpected, SetTerminate, SetUnexpected, * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
TerminateFunctionCall. TerminateFunctionCall.
(init_exception_processing): Likewise. Terminate et al are now (init_exception_processing): Likewise. Terminate et al are now
......
...@@ -5488,9 +5488,11 @@ build_const_cast (type, expr) ...@@ -5488,9 +5488,11 @@ build_const_cast (type, expr)
} }
if (comp_ptr_ttypes_const (TREE_TYPE (type), intype)) if (comp_ptr_ttypes_const (TREE_TYPE (type), intype))
return (convert_from_reference {
(convert_to_reference (type, expr, CONV_CONST|CONV_IMPLICIT, expr = build_unary_op (ADDR_EXPR, expr, 0);
LOOKUP_COMPLAIN, NULL_TREE))); expr = build1 (NOP_EXPR, type, expr);
return convert_from_reference (expr);
}
} }
else if (TREE_CODE (type) == POINTER_TYPE else if (TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (intype) == POINTER_TYPE && TREE_CODE (intype) == POINTER_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