[cfe-dev] c++ templates

Sebastian Redl sebastian.redl at getdesigned.at
Sat Nov 15 08:50:15 PST 2008


Andrew Sutton wrote:
>
>     Attached is a very (VERY) preliminary stab at the beginning of
>     template parsing for clang. It's not complete, it doesn't do
>     anything, there's no AST stuff, I haven't even considered scopes
>     and name resolution, etc., etc. It just recognizes "template
>     <...>". I had hoped to spend some spare time, an hour or so a day
>     (whenever possible) to continue working on this. Please bear in
>     mind that a) I've never worked on a real compiler before and b) I
>     probably don't fully understand the requirements of what I'm
>     working on.
>
>     I hope this is an adequate start.
>
>
> What should I be doing with the templates patch? Its growing steadily 
> larger and I'll probably get to a point soon where I have to step on a 
> lot of code to get anything else built.
When it's in a state where it has some closure (e.g. parsing 
declarations works, even if you can't actually use those parameters and 
sema never hears of it or treats it as non-templates), and you've 
written a few test cases, submit it for review. It has to do something 
useful (at least for testability), it should not crash the compiler 
under any circumstances.

I think a big discussion is in order before touching sema of templates 
anyway. We have to plan the template engine.

Sebastian



More information about the cfe-dev mailing list