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: g++ bug with classes nested inside functions


>>>>> "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


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