This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: V3 problems
- To: mark at codesourcery dot com (Mark Mitchell)
- Subject: Re: V3 problems
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Mon, 5 Feb 2001 12:59:37 -0800 (PST)
- Cc: dje at watson dot ibm dot com, bkoz at nabi dot net, gcc at gcc dot gnu dot org
Mark writes:
> # We have to handle misc-inst.cc and locale-inst.cc in a special way
> # since we cannot instantiate all classes due to missing definitions
> # for things like vptrs, type_info bits, etc. when using
> # -fno-implicit-templates.
> ...
> That comment sounds wrong to me. If it is correct, then I think we
> have a bug in the compiler proper. There is no reason that the vptr
> and type_info bits shouldn't be emitted when an explicit instantiation
> is done; in fact, they should be.
I think that the proper way to handle this is to use the same heuristic
that is used elsewhere: the definition for the vtbl and type_info stuff
goes in the same .o file that defines the first noninline, nonpure virtual
function. If an .o file gets an definition of that function due to
explicit template expansion, it should also get a definition of the vtbl
and type_info bits.