This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Multiple inheritance bug (ICE 980715)


Thanks again for your report. Here is a fix.

Martin

1998-09-20  Martin von L÷wis  <loewis@informatik.hu-berlin.de>

	* method.c (hack_identifier): Finding multiple members is always
	an error.

--- /dev/null	Mon Jul 18 01:46:18 1994
+++ g++.martin/ambig1.C	Sun Sep 20 21:05:39 1998
@@ -0,0 +1,21 @@
+//Build don't link:
+struct foo {
+  protected:
+    int x;
+};
+
+struct bar {
+  public:
+    int x();
+};
+
+struct foobar: public foo, public bar {
+  foobar();
+};
+
+int func(int);
+
+foobar::foobar()
+{
+    func(x);       // ERROR - ambiguous member access
+}
Index: method.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/method.c,v
retrieving revision 1.75
diff -c -p -r1.75 method.c
*** method.c	1998/09/07 14:25:13	1.75
--- method.c	1998/09/20 18:57:04
*************** hack_identifier (value, name)
*** 1944,1957 ****
      }
    else if (TREE_CODE (value) == TREE_LIST && TREE_NONLOCAL_FLAG (value))
      {
!       if (type == 0)
! 	{
! 	  error ("request for member `%s' is ambiguous in multiple inheritance lattice",
! 		 IDENTIFIER_POINTER (name));
! 	  return error_mark_node;
! 	}
! 
!       return value;
      }
  
    if (! processing_template_decl)
--- 1944,1952 ----
      }
    else if (TREE_CODE (value) == TREE_LIST && TREE_NONLOCAL_FLAG (value))
      {
!       error ("request for member `%s' is ambiguous in multiple inheritance lattice",
! 	     IDENTIFIER_POINTER (name));
!       return error_mark_node;
      }
  
    if (! processing_template_decl)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]