g++ bug with classes nested inside functions
Mark Mitchell
mark@codesourcery.com
Tue Nov 30 23:39:00 GMT 1999
>>>>> "Ian" == Ian Lance Taylor <ian@zembu.com> writes:
Ian> Consider this file:
Ian> class cp { public: virtual int fn () = 0; };
Ian> int main () { class cc : public cp { public: int fn () {
Ian> return 0; } };
Ian> cc v; return v.fn (); }
Ian> If I compile this with -O, and link the result, I get this
Ian> error:
Ian> foo.o: In function `main.0::cc type_info function':
Ian> /home/ian/foo.cc:17: undefined reference to
Ian> `fn__Q26main.0_2cc.0'
Ian> It seems that g++ never emitted cc::fn.
This is a known bug. I'm actually planning on fixing this; Jason and
I have talked about this and understand what the problem is. But, it
will probably take a few weeks to get to, I'm afraid.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc-bugs
mailing list