Improve recovery for lambda expressions that have 'mutable' or a
trailing return type but not a '()'. Recover by inserting the
parentheses. Thanks to Xeo on IRC for the example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150727 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index aa2a9cf..a25116b 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -20,6 +20,8 @@
[&,foo] () {};
[this] () {};
+ [] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}}
+ [] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}}
return 1;
}