<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is the TemplateDecl getting returned all the way through to ParseExternalDeclaration? That's how declarations get back to the<div class="Ih2E3d">
</div></blockquote><div><br>Knowing that helps a *lot*. Here's iteration n + 1. This starts to add -ast-print support for class templates, but it doesn't print template parameters just yet. You'll get "template <...> Read top-level tag...".<br>
<br>Getting this to work is... not very pretty. It's actually pretty tough to push the TemplateDecl all the way up to ParseExternalDeclaration since, somewhere in the call sequence, the created declaration node is wrapped in a DeclSpec (in ParseDeclarationOrFunctionDefinition IIRC) and ActOnTag only returns a TagDecl. I modified ActOnTag to return *either* a TagDecl or a TemplateDecl. This has the unfortunate side-effect of requiring you to think about DeclTy's in the Action interface as either a Tag or Template. It's easy to get the Tag from the Template, but unfortuntely you still have to perform the cast (so far only in 3 places). This also means that I'm setting the TypeRep of a DeclSpec as a TemplateDecl, which may or may not have unseen consequences down the road.<br>
<br>It's a big patch, but I tried to make it as unintrusive as possible. Best of all, it doesn't cause any regressions on my system.<br></div></div><br>Andrew Sutton<br><a href="mailto:andrew.n.sutton@gmail.com">andrew.n.sutton@gmail.com</a><br>