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

Douglas Gregor dgregor at apple.com
Thu Aug 4 08:34:15 PDT 2011

On Aug 4, 2011, at 6:54 AM, John Freeman wrote:

> On 8/3/11 12:23 PM, David Blaikie wrote:
>> I'd had the same thought when I was adding test cases&  fixing a
>> couple of bugs, but when I went to rewrite it I wasn't confident
>> enough that I could come up with a better solution. After reading this
>> feedback I went back to have another go&  came up with the version
>> I've attached (this includes everything I sent out in my last email,
>> plus a couple more test cases around the effected paths).
> I incorporated David's changes and tests into the attached patch. I moved CXX0XLambda* helper structs to Sema/DeclSpec.h. I feel they belong in Sema since they will be used in the lambda actions. I chose Sema/DeclSpec.h because they seemed Declarator-ish and I did not want to create a separate file unless it was necessary.

Sema/DeclSpec.h is a good place for these.

I've gone ahead and committed this as r136876, with a few tweaks:

	1) I dropped the CXX0X prefix, since Clang better not have multiple language features called "lambda"
	2) I pushed range information through ParseTrailingReturnType, so that the DeclEndLoc could be updated appropriately
	3) I modified one of the parsing test cases to not emit that "return from a void function" error. We'll actually test this when more semantic analysis comes along

Thanks John and David!

	- Doug

More information about the cfe-commits mailing list