* error.c (dump_expr): Avoid printing (*&i) for references.
authorJason Merrill <jason@redhat.com>
Fri, 21 Nov 2014 00:47:45 +0000 (19:47 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 21 Nov 2014 00:47:45 +0000 (19:47 -0500)
From-SVN: r217899

gcc/cp/ChangeLog
gcc/cp/error.c

index 2c98a7103d1292f936572386577f077bc0b16890..305565fa350237551f7def4e58cb38b20d5482a2 100644 (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
index 76f86cb0d74bc43d3e2b842ec1a170b0eb939eb0..7d79771ec267fcf948bc7d289da38124ce5cdae4 100644 (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);
          }