tstellar / rpms / gcc

Forked from rpms/gcc 4 years ago
Clone
0d16b69
2007-11-30  Jakub Jelinek  <jakub@redhat.com>
0d16b69
0d16b69
	PR c++/34275
0d16b69
	* error.c (dump_expr): Handle OBJ_TYPE_REF.
0d16b69
0d16b69
	* g++.dg/other/error20.C: New test.
0d16b69
0d16b69
--- gcc/cp/error.c	(revision 130532)
0d16b69
+++ gcc/cp/error.c	(revision 130533)
0d16b69
@@ -2056,6 +2056,10 @@ dump_expr (tree t, int flags)
0d16b69
       pp_expression (cxx_pp, t);
0d16b69
       break;
0d16b69
 
0d16b69
+    case OBJ_TYPE_REF:
0d16b69
+      dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags);
0d16b69
+      break;
0d16b69
+
0d16b69
       /*  This list is incomplete, but should suffice for now.
0d16b69
 	  It is very important that `sorry' does not call
0d16b69
 	  `report_error_function'.  That could cause an infinite loop.  */
0d16b69
--- gcc/testsuite/g++.dg/other/error20.C	(revision 0)
0d16b69
+++ gcc/testsuite/g++.dg/other/error20.C	(revision 130533)
0d16b69
@@ -0,0 +1,12 @@
0d16b69
+// PR c++/34275
0d16b69
+// { dg-do compile }
0d16b69
+
0d16b69
+struct A
0d16b69
+{		// { dg-error "candidates" }
0d16b69
+  virtual A foo ();
0d16b69
+};
0d16b69
+
0d16b69
+void bar (A& a)
0d16b69
+{
0d16b69
+  a.foo () = 0; // { dg-error "A::foo\\(\\) = 0" }
0d16b69
+}