Problem with templates used in a class member.

Ram'on Garc'ia ramon@jl1.quim.ucm.es
Thu Sep 10 17:58:00 GMT 1998


On Thu, 10 Sep 1998, Alexandre Oliva wrote:
> The correct approach to fix this problem is to allow the address of a
> member to be taken even if the class is not yet fully defined (but it
> must not be just a forward-declared class or template specialization).
> The test of whether the class type is completely defined should not be
> performed in this case.  Unfortunately, I don't have the faintest idea
> of how to map these ideas onto the existing code.
> 
> > An approach could be to delay the instatation of the template until
> > the declaration of the class is complete, probably placing some
> > hooks in the class node.
> 
> I believe this might introduce some problems related with point of
> instantiation of templates.

Perhaps you are right, but how can you find the members of class while the
declaration of the class has not ended (and, therefore, the class is
incomplete)? In the EGCS source, I can find a class member when the class
is complete, looking at the syntax tree. But if the class is not
complete, I do not know how to find it.

A solution could be that incomplete classes can have members attached to
it, probably generating a new state for classes: "in progress".

Can any EGCS expert give advise, please?

Ramon




More information about the Gcc mailing list