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: No definition of virtual function, omits inline and virtualtable


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


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