This is the mail archive of the gcc-bugs@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: Internal compiler error when mistakenly taking the address of a pure virtual method


Strange, I could only reproduce your problem after I replaced `class'
with `struct':

struct Base { virtual bool isSomething() const = 0; };

struct Derived : Base { virtual bool isSomething() const; };

int main() { Base* derived = new Derived();
  bool ret = derived->isSomething; }

Anyway, the problem is fixed in the latest snapshot; it says:

test.cc: In function `int main()':
test.cc:6: warning: assuming & on `(*derived) .* (*(derived->Base::_vptr$Base + 16))'
test.cc:6: sorry, not implemented: address of bound pointer-to-member expression

The error message is not exactly what one might expect, especially
considering that a C++ compiler is not even expected to implement
bound pointer-to-member pointers.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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