This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ bug with classes nested inside functions
- To: ian at zembu dot com
- Subject: Re: g++ bug with classes nested inside functions
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 16 Nov 1999 21:44:16 -0800
- Cc: gcc-bugs at sourceware dot cygnus dot com
- Organization: CodeSourcery, LLC
- References: <19991117023927.6666.qmail@daffy.airs.com>
>>>>> "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