]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/34275 (Broken diagnostic: 'obj_type_ref' not supported by dump_expr)
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 Nov 2007 07:24:54 +0000 (08:24 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 Nov 2007 07:24:54 +0000 (08:24 +0100)
PR c++/34275
* error.c (dump_expr): Handle OBJ_TYPE_REF.

* g++.dg/other/error20.C: New test.

From-SVN: r130533

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/error20.C [new file with mode: 0644]

index 5ff2fa330db38a4debd0b8ef8cffac0112d3ac84..b8f1e889de9e876edd53b75454d30b12e9cc50a2 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34275
+       * error.c (dump_expr): Handle OBJ_TYPE_REF.
+
 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/34270
index 49ded5e496b21bf3af4c8eaf7149689f36611282..9446f2aa0c3d6e57f15a0db46974d99ebb0815a7 100644 (file)
@@ -2056,6 +2056,10 @@ dump_expr (tree t, int flags)
       pp_expression (cxx_pp, t);
       break;
 
+    case OBJ_TYPE_REF:
+      dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags);
+      break;
+
       /*  This list is incomplete, but should suffice for now.
          It is very important that `sorry' does not call
          `report_error_function'.  That could cause an infinite loop.  */
index 50468f9463ff43793b836c7280e63964076377c8..229fb0a124821394a3b72e64e1ba59b0401ed4a5 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/34275
+       * g++.dg/other/error20.C: New test.
+
 2007-11-29  Steven G. Kargl  <kargls@comcast.net>
 
        PR fortran/34230
diff --git a/gcc/testsuite/g++.dg/other/error20.C b/gcc/testsuite/g++.dg/other/error20.C
new file mode 100644 (file)
index 0000000..3c8e8f2
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/34275
+// { dg-do compile }
+
+struct A
+{              // { dg-error "candidates" }
+  virtual A foo ();
+};
+
+void bar (A& a)
+{
+  a.foo () = 0; // { dg-error "A::foo\\(\\) = 0" }
+}