[cfe-dev] QualifiedTemplateName as inner type of an ElaboratedType ?

John McCall rjmccall at apple.com
Tue Jun 8 01:05:29 PDT 2010


On Jun 5, 2010, at 11:41 PM, Abramo Bagnara wrote:

> Il 05/06/2010 22:49, John McCall ha scritto:
>> On Jun 5, 2010, at 3:36 AM, Enea Zaffanella wrote:
>>> Should clang get rid of the redundant qualification in the 
>>> ElaboratedType (and DependentNameType) whenever the inner type already 
>>> has name qualification info (i.e., a QualifiedTemplateName or a 
>>> DependentTemplateName and maybe others)?
>>> 
>>> Or should clang rather insist on a stronger (and simpler?) design where 
>>> a TemplateName is *never* qualified, i.e., any qualifier should be 
>>> encoded as an external ElaboratedType (or DependentNameType) wrapper?
>> 
>> This would be better;  I don't think we really get anything out of the current
>> redundancy in TemplateName.  We might need a
>> DependentTemplateSpecializationType first, though.
> 
> I'd like to make the following proposal to rationalize this area of type
> system:
> 
> - introduce UnresolvedNameType (it contains only an IdentifierInfo*)

This isn't appropriate for a canonical type system.  How would such a type
canonicalize?  A<T>::foo and B<T>::foo have different canonical types.

I still think a DependentTemplateSpecializationType in parallel with
DependentNameType would be more appropriate.  Like DNT, it would
instantiate to an ElaboratedType, only the inner type would be a TST
instead of some sort of TypeDecl type.

I'll implement this tomorrow.

John.



More information about the cfe-dev mailing list