aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx0x-lambda-expressions.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-16 21:53:36 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-16 21:53:36 +0000
commitc9ecec404fe28d53aa49b3c830d8353e97bea5f2 (patch)
tree4aaf2e993d195dc55121a5c5825f12aef51caf73 /test/Parser/cxx0x-lambda-expressions.cpp
parent3f77c7b56d515a6756dba63a3dfa0a332711a779 (diff)
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
Diffstat (limited to 'test/Parser/cxx0x-lambda-expressions.cpp')
-rw-r--r--test/Parser/cxx0x-lambda-expressions.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index aa2a9cf7fd..a25116b460 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -20,6 +20,8 @@ class C {
[&,foo] () {};
[this] () {};
+ [] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}}
+ [] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}}
return 1;
}