[cfe-dev] Repeated NNS in Elaborated types?

Enea Zaffanella zaffanella at cs.unipr.it
Wed Mar 2 15:22:38 PST 2011


Il 02/03/2011 18:26, Douglas Gregor ha scritto:
> 
> On Mar 2, 2011, at 8:44 AM, Enea Zaffanella wrote:
[...]
>> Does this sound as a reasonable approach?
> 
> 
> Good find. I hadn't realized that this duplication actually occurred
> in our ASTs.
> 
> However, I suggest that we take the opposite approach: when we see
> that we're building a TemplateSpecializationType with a
> QualifiedTemplateName, map that QTN down to the underlying template
> name.

We had a try on this, but we start suspecting that we have not enough
confidence with this portion of clang code, which also seems to be
changing very quickly. It is unclear to us, for instance, whether a QTN
can be mapped to a simple template name without breaking the existing
invariants. So, if you have a clearer picture of what needs to be done,
then your help will be greatly appreciated. On our side, we will keep
checking the accuracy of source location info and provide all feedback
we can.

Regards,
Enea.

> The reasoning is that we'd like to move away from using
> TemplateName as the representation for the template in
> TemplateSpecializationType, and instead use a TemplateDecl * [1].
> However, stripping off the QualifiedTemplateName would be a step in
> the right direction.
> 
> - Doug
> 
> [1] Even better: introduce a TypeTemplateDecl into the Decl
> hierarchy, which is the common superclass of ClassTemplateDecl,
> TemplateTemplateParmDecl, and the not-yet-implemented
> AliasTemplateDecl. This isn't trivial, since RedeclarableTemplate
> currently gets in the way.



More information about the cfe-dev mailing list