[cfe-commits] [PATCH] Parsing C++0x lambda expressions

What is the best place to keep the lambda 'mutable' location? Declarator, or perhaps DeclSpec, or DeclaratorChunk::FunctionTypeInfo (my best guess)?

Also, there is an EllipsisLoc in Declarator. I don't see any code using it in either DeclSpec.h or DeclSpec.cpp. Is it used?

- John

+ // Parse lambda-declarator[opt].
+ // FIXME: Should we default the type quals, or store mutability in this?
+ DeclSpec DS(AttrFactory);

Parse as it's written, and let Sema/AST deal with the mutability.

+ // Parse 'mutable'[opt].
+ if (Tok.is(tok::kw_mutable)) {
+ // FIXME: How should we add this to the declarator? Should we instead
+ // add const-ness if we do not see 'mutable'?
+ ConsumeToken();
+ }

Just extend the Declarator class with a location for the lambda 'mutable' and Sema will deal with it.

What is the best place to keep the lambda 'mutable' location? Declarator, or perhaps DeclSpec, or DeclaratorChunk::FunctionTypeInfo (my best guess)?

DeclaratorChunk::FunctionTypeInfo is fine.

Also, there is an EllipsisLoc in Declarator. I don't see any code using it in either DeclSpec.h or DeclSpec.cpp. Is it used?

Parameter packs use it.