From e4c4792d37be8f7835dac75e929e7011ccba91fa Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 20 Nov 2014 19:47:45 -0500 Subject: [PATCH] * error.c (dump_expr): Avoid printing (*&i) for references. From-SVN: r217899 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/error.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c98a7103d1..305565fa350 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2014-11-20 Jason Merrill + + * error.c (dump_expr): Avoid printing (*&i) for references. + 2014-11-20 Ville Voutilainen PR c++/63959 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 76f86cb0d74..7d79771ec26 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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); } -- 2.30.2