* error.c (dump_expr): Avoid printing (*&i) for references.

From-SVN: r217899
This commit is contained in:
Jason Merrill 2014-11-20 19:47:45 -05:00 committed by Jason Merrill
parent b33928046e
commit e4c4792d37
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2014-11-20 Jason Merrill <jason@redhat.com>
* error.c (dump_expr): Avoid printing (*&i) for references.
2014-11-20 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/63959

View File

@ -2299,7 +2299,13 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
TREE_TYPE (ttype)))
{
if (TREE_CODE (ttype) == REFERENCE_TYPE)
dump_unary_op (pp, "*", t, flags);
{
STRIP_NOPS (op);
if (TREE_CODE (op) == ADDR_EXPR)
dump_expr (pp, TREE_OPERAND (op, 0), flags);
else
dump_unary_op (pp, "*", t, flags);
}
else
dump_unary_op (pp, "&", t, flags);
}