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

Douglas Gregor dgregor at apple.com
Thu Jul 28 18:07:29 PDT 2011


On Jul 21, 2011, at 12:18 PM, John Freeman wrote:

> Attached is an updated patch. It is generated with "git diff --no-prefix"; will that be ok?

Yes.

The code looks great!

> I added a small test to get started.

Okay, we'd like some additional tests in here to make sure that the disambiguation is working properly, the diagnostics work properly, etc.

Regarding:

+// FIXME: -Wno-return-type is necessary because we do not yet handle lambda
+// scopes properly. My first thought was that the flag would be unnecessary
+// because it is a semantic (not syntactic) check. I cannot find documentation
+// on the -verify flag, but removing it does not remove the return type check.

Grep around the test-suite for "expected-warning"; that's how to get -verify to pass cleanly. Basically, -verify checks the compiler's generated diagnostics against the expected-warning and expected-error markup in the file, a bit like DejaGNU has dg-warning and dg-error for GCC (but built into Clang).

> Would there be any problems with copying tests from GCC?


We really can't just copy a pile of their tests. Sorry, you'll need to actually write a bunch of new tests [*].

With some good testing, though, I think your patch is ready to go in.

	- Doug

[*] I had to do the same ridiculous dance for variadic templates :)




More information about the cfe-commits mailing list