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

John Freeman jfreeman at cse.tamu.edu
Thu Jul 7 11:35:46 PDT 2011


On 7/6/2011 2:59 PM, Douglas Gregor wrote:
> +  // 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)?

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



More information about the cfe-commits mailing list