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