diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-02-16 21:53:36 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-02-16 21:53:36 +0000 |
| commit | 6746c5d4873f25cafc98a07160d943b5017f807e (patch) | |
| tree | 84f94f47bc821af3e1609d0f105aea364a3a1f22 /clang/test/Parser/cxx0x-lambda-expressions.cpp | |
| parent | 638252fb5ace7b90d24ba073217f654ffd3d6ab0 (diff) | |
| download | bcm5719-llvm-6746c5d4873f25cafc98a07160d943b5017f807e.tar.gz bcm5719-llvm-6746c5d4873f25cafc98a07160d943b5017f807e.zip | |
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.
llvm-svn: 150727
Diffstat (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp')
| -rw-r--r-- | clang/test/Parser/cxx0x-lambda-expressions.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index aa2a9cf7fd2..a25116b460a 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/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; } |

