This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: No definition of virtual function, omits inline and virtualtable
- To: Peter Osterlund <peter dot osterlund at mailbox dot swipnet dot se>
- Subject: Re: No definition of virtual function, omits inline and virtualtable
- From: Jim Carter <jimc at math dot ucla dot edu>
- Date: Thu, 28 Sep 2000 20:38:38 -0700 (PDT)
- cc: gcc-bugs at gcc dot gnu dot org
Oops. You are correct that the test case doesn't actually demonstrate the
bug. In an attempt to clarify the situation I split the program into 3
files: class definition (header), virtual functions, and everything else.
As I complained, the virtual table was not emitted in the compilation unit
that lacked the virtual functions. However, in the compilation unit with
the virtual function the virtual table and type_info were emitted, so the
complete program could link and execute. In other trials, =0 (abstract
designator) in the class definition also caused the virtual table to be
emitted with a W category so the linker doesn't complain about multiple
definitions.
So this bug report is hereby withdrawn. I'm sorry to take your time on a
non-bug.
James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Internet: jimc@math.ucla.edu (finger for PGP key)
UUCP:...!{ucsd,ames,ncar,gatech,purdue,rutgers,decvax,uunet}!math.ucla.edu!jimc
On Wed, 27 Sep 2000, Peter Osterlund wrote:
> On Wed, 27 Sep 2000, James F. Carter wrote:
>
> : But the point is, that compilation unit was botched. As you say, the
> : program as a whole was malformed, and could not have executed (at best
> : getting an undefined symbol at link time), but the missing virtual function
> : *could* have been defined in a different compilation unit and linked
> : in. That should be legal, but no inline bodies or virtual table would have
> : been generated.
>
> In what way was the compilation unit botched? The errors I got was during
> linking, not during compilation. The file compiles but does not link, so
> your test case does not demonstrate any compiler bug.
>
> --
> Peter Österlund Email: peter.osterlund@mailbox.swipnet.se
> Sköndalsvägen 35 f90-pos@nada.kth.se
> S-128 66 Sköndal Home page: http://home1.swipnet.se/~w-15919
> Sweden Phone: +46 8 942647
>
>