[cfe-commits] r64153 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/DeclTemplate.h include/clang/AST/Type.h include/clang/Parse/Action.h include/clang/Parse/Parser.h lib/AST/ASTContext.cpp lib/AST/DeclTemplate.cpp lib/AST/Type.cpp lib/AST/TypeSerialization.cpp lib/CodeGen/CodeGenTypes.cpp lib/Parse/MinimalAction.cpp lib/Parse/ParseDecl.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseTemplate.cpp lib/Parse/Parser.cpp lib/Sema/Sema.h lib/Sema/SemaTemplate.cpp test/SemaTemplate/class-template-id.cpp

Chris Lattner clattner at apple.com
Tue Feb 10 16:59:55 PST 2009


On Feb 9, 2009, at 12:58 PM, Douglas Gregor wrote:

>
> On Feb 9, 2009, at 12:05 PM, Sebastian Redl wrote:
>
>> Douglas Gregor wrote:
>>> Author: dgregor
>>> Date: Mon Feb  9 12:46:07 2009
>>> New Revision: 64153
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=64153&view=rev
>>> Log:
>>> Start processing template-ids as types when the template-name refers
>>> to a class template. For example, the template-id 'vector<int>' now
>>> has a nice, sugary type in the type system. What we can do now:
>>>
>>> - Parse template-ids like 'vector<int>' (where 'vector' names a
>>>   class template) and form proper types for them in the type system.
>>> - Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
>>>   using (sadly) a bool in the parser to tell it whether '>' should
>>>   be treated as an operator or not.
>>>
>> I suppose it can't be helped.
>
> The only other option I can think of would be to pass it as a boolean
> flag down the stack... that's almost worse :)

Naive question: is this just a matter of parsing the expression  
starting at the right precedence level?

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090210/dc45527b/attachment.html>


More information about the cfe-commits mailing list