<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 24, 2008, at 11:45 AM, Andrew Sutton wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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;"> This is in the tree now. Basically, we keep track of the template parameter lists that we've parsed and then provide those to the various Action routines that will end up constructing templates, e.g., ActOnTag for creating class templates (but not enum templates <g>).<br> <br> The Depth/Position stuff is working toward a fix in the type system. Basically, template parameters in the type system will be identified by their kind, depth (= the number of enclosing template parameter lists), and position with in that template parameter list. For example, 'T' in<div class="Ih2E3d"> <br> <br>        template<typename T> void foo(T);<br> <br></div> is a template type parameter with depth=0 and position=0. That's the canonical type for 'T', and we'll use some sugar to give it the name 'T'. That way, we can quickly match the declaration above with the definition below<br> <br>        template<class U> void foo(U) { }<br> <br>        - Doug<br> </blockquote></div><br>I just merged my patches onto yours and started stubbing out some declaration classes. I also broke the template node declarations out into DeclTemplates.h/cpp so I could navigate around a little easier. It's included at the bottom of DeclCXX for now. The new code doesn't really *do* anything yet.</blockquote><div><br></div><div>Splitting the code out into DeclTemplate.h/.cpp makes a lot of sense. For the most part, clients of a completed AST won't need to deal with the AST nodes in DeclTemplate.h.</div><div><br></div><blockquote type="cite">Also, I'm not entirely sure how to use TemplateParameterList. It's not quite like any "list/array/vector" structure that I've run across. I'm guessing that I'd have TemplateDecl contain a ptr to it, since the list is likely created and populated during parsing.</blockquote><div><br></div><div>Right. ActOnTemplateParameterList creates them, and they'll go into ActOnTag, ActOnDeclarator, etc., where they'll get hooked into a TemplateDecl.</div><br><blockquote type="cite"><br>I merged the changes into Dan (Christiansen's) Mercurial mirror on BitBucket, here:<br> <br><a href="http://bitbucket.org/danchr/clang/">http://bitbucket.org/danchr/clang/</a><br><br>It's just a start, an offering for comments. More code to follow, but probably not today or tomorrow.<br></blockquote></div><br><div>Aside from the move to DeclTemplate.h/.cpp, I'm having a hard time determining what else has changed here. Is there something specific I can look at?</div><div><br></div><div>  - Doug</div></body></html>