Misleading typo in C++ error

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun Feb 6 04:28:00 GMT 2000


> I suppose the error message on line 6 should print '&a' instead of `+a',
> just as it does on line 9?

Thanks for your bug report. Here is a patch.

Martin

2000-02-06  Martin v. Löwis  <loewis@informatik.hu-berlin.de>

	* error.c (dump_expr): Correctly output &parm.

Index: error.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/error.c,v
retrieving revision 1.102
diff -u -r1.102 error.c
--- error.c	2000/01/26 20:51:34	1.102
+++ error.c	2000/02/06 12:19:12
@@ -1748,6 +1748,14 @@
 	  OB_PUTS ("(void)");
 	  dump_expr (TREE_OPERAND (t, 0), flags);
 	}
+      else if ((TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
+	       && (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) 
+		   == REFERENCE_TYPE))
+	{
+	  /* This was simplified from &*x, and does not indicate a
+	     unary plus.  */
+	  dump_unary_op ("&", t, flags);
+	}
       else
 	dump_unary_op ("+", t, flags);
       break;


More information about the Gcc-bugs mailing list