[cfe-dev] Templates (again)

Douglas Gregor dgregor at apple.com
Wed Dec 31 11:18:36 PST 2008


On Dec 30, 2008, at 7:27 PM, Andrew Sutton wrote:

>
>
> Building a patch against svn shouldn't be too much trouble. I'm  
> going try to finish off the template-template param basics with ast- 
> print support (hopefully) without introducing any regressions before  
> submitting.
>
>
> Okay.
>
> It turns out to be impossible to ast-print template template  
> parameters without handling template declarations. This seems so  
> obvious in retrospect... So I'm working on AST building for class  
> templates. It's kind of working, but I can't seem to get the  
> DeclPrinter to see top-level template declarations. Probably some  
> kind of weird name conflict because I'm forcing the TemplateDecl to  
> take the same name as its underlying ScopedDecl.

Is the TemplateDecl getting returned all the way through to  
ParseExternalDeclaration? That's how declarations get back to the

>
> Quick question though. You started building support for depth/ 
> position stuff for template parameters, but the values aren't  
> handled in Sema. Are you envisioning the depth/position as  
> properties of template parameters or will they be dealt with  
> elsewhere?

For template type parameters, the depth and position will become a  
part of the Type. For non-type and template template parameters,  
they'll probably be a part of the Decl. However, templates might need  
to be "types" in the type system, in which case template template  
parameters would probably have a specific kind of type; I haven't  
thought about this part much, yet.

	- Doug



More information about the cfe-dev mailing list