Bug report - private inheritance

Philippe Bouchard boucp00@DMI.USherb.CA
Sun Nov 7 22:55:00 GMT 1999


The following:
#include <iostream.h>
template <class TYPE>
struct EXT {
   TYPE * operator -> () const {
      return (TYPE *) this; }
   };
struct A : EXT<A> {
   void func() {
      cout<<__PRETTY_FUNCTION__<<endl;
}
   };
struct B : EXT<B>, private A {
   void func() {
      cout<<__PRETTY_FUNCTION__<<endl;
}
   };
void main() {
   A a;
   B b;
   a->func();
   b->func();
   };
Reports:
ext.cc: In function `int main(...)':
ext.cc:23: request for method `operator ->' is ambiguous
With:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 
PAB



More information about the Gcc-bugs mailing list