Bug 69 - Multiple inheritance bug
Summary: Multiple inheritance bug
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.2
: P3 normal
Target Milestone: ---
Assignee: Nathan Sidwell
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2000-03-05 10:36 UTC by martin
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2000-03-05 10:36:01 UTC
 Date: 07 Feb 2000 16:50:03 -0600
 Original-Message-ID: <fxdbt5smxus.fsf@salsa.cs.wisc.edu>

 I am using this version of g++:

   Reading specs from /s/gcc-2.95.2/sun4x_56/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs 
   gcc version 2.95.2 19991024 (release) 

 and running g++ on this file:

 class eel_private_executable
 {
 public:
   virtual void read_section_descriptors() = 0;
 };

 class executable : public eel_private_executable
 {
 };


 class eel_bfd_executable : public virtual executable
 {
 public:
   virtual void read_section_descriptors();
 };


 class eel_arch_executable : public virtual executable
 {
 };

 class eel_archive_executable : public eel_arch_executable,
				public eel_bfd_executable
 {
 public:
   virtual void read_contents();
 };


 void
 eel_archive_executable::read_contents()
 {
   read_section_descriptors();
 }

 When I run g++ like this:

   g++ -c eel_executable_cpp.C 

 I get this error message:

   eel_executable_cpp.C: In method `void eel_archive_executable::read_contents()': 
   eel_executable_cpp.C:35: request for member `read_section_descriptors' is ambiguous in multiple inheritance lattice 
   eel_executable_cpp.C:5: candidates are: void eel_private_executable::read_section_descriptors() 
   eel_executable_cpp.C:16:                 void eel_bfd_executable::read_section_descriptors() 

 This is a bug because eel_private_executable::read_section_descriptors 
 is abstract, so it can't possibly conflict with
 eel_bfd_executable::read_section_descriptors.

 On my system, uname -a says

   SunOS cabernet 5.6 Generic_105181-17 sun4u sparc

 Thanks.
 --glenn

Release:
2.95.2

How-To-Repeat:
[nathan]
This is a bug, but not because of the abstractness or otherwise
of eel_private_executable::read_section_descriptors.
10.2/6 give examples of this kind of thing, and make it clear
that even though the virtual base is visible via one path,
the fact that it is hidden via another causes this to be
unambiguous.
[nathan]
2000-06-26  Nathan Sidwell  <nathan@codesourcery.com>

        * search.c (hides): Remove.
        (is_subobject_of_p): Add most_derived parameter. Use
        CANONICAL_BINFO.
        (lookup_field_queue_p): Adjust.
        (lookup_field_r): Adjust.
Comment 1 Martin v. Loewis 2000-03-08 23:42:56 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed as a bug
Comment 2 Martin v. Loewis 2000-03-09 07:42:56 UTC
From: loewis@gcc.gnu.org
To: <ammons@cs.wisc.edu>, gcc-gnats@gcc.gnu.org,
  martin@loewis.home.cs.tu-berlin.de, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/69
Date: 9 Mar 2000 07:42:56 -0000

 Synopsis: Multiple inheritance bug
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: loewis
 State-Changed-When: Wed Mar  8 23:42:56 2000
 State-Changed-Why:
     Confirmed as a bug  
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=69&database=gcc
Comment 3 Nathan Sidwell 2000-06-26 04:32:29 UTC
Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-Why: Patch in progress
Comment 4 Nathan Sidwell 2000-06-26 06:18:10 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed
Comment 5 Nathan Sidwell 2000-06-26 11:32:29 UTC
From: nathan@gcc.gnu.org
To: ammons@cs.wisc.edu, gcc-gnats@gcc.gnu.org,
  martin@loewis.home.cs.tu-berlin.de, nathan@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/69
Date: 26 Jun 2000 11:32:29 -0000

 Synopsis: Multiple inheritance bug
 
 Responsible-Changed-From-To: unassigned->nathan
 Responsible-Changed-By: nathan
 Responsible-Changed-When: Mon Jun 26 04:32:29 2000
 Responsible-Changed-Why:
     Patch in progress
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=69&database=gcc
Comment 6 Nathan Sidwell 2000-06-26 13:18:10 UTC
From: nathan@gcc.gnu.org
To: ammons@cs.wisc.edu, gcc-gnats@gcc.gnu.org,
  martin@loewis.home.cs.tu-berlin.de, nathan@gcc.gnu.org
Cc:  
Subject: Re: c++/69
Date: 26 Jun 2000 13:18:10 -0000

 Synopsis: Multiple inheritance bug
 
 State-Changed-From-To: analyzed->closed
 State-Changed-By: nathan
 State-Changed-When: Mon Jun 26 06:18:10 2000
 State-Changed-Why:
     Fixed
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=69&database=gcc