diff options
| author | Daniel Jasper <djasper@google.com> | 2013-09-05 10:04:31 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-09-05 10:04:31 +0000 |
| commit | 9a8d48b5e1df1c459625bef47d36424bd25c7efb (patch) | |
| tree | e09792102e7b727d2a2ecb4f35d5f938b989f288 /clang/lib/Format/TokenAnnotator.cpp | |
| parent | 9fe0e8dacdb36520bd93ed720afd4ce045931a44 (diff) | |
| download | bcm5719-llvm-9a8d48b5e1df1c459625bef47d36424bd25c7efb.tar.gz bcm5719-llvm-9a8d48b5e1df1c459625bef47d36424bd25c7efb.zip | |
clang-format: Fix parsing and indenting lambdas.
Before:
void f() {
other(x.begin(), x.end(), //
[&](int, int) { return 1; });
}
After:
void f() {
other(x.begin(), x.end(), //
[&](int, int) { return 1; });
}
llvm-svn: 190039
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 9e17ee9f6c9..46baab4aab3 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -201,7 +201,8 @@ private: while (CurrentToken != NULL) { if (CurrentToken->is(tok::r_square)) { - if (CurrentToken->Next && CurrentToken->Next->is(tok::l_paren)) { + if (CurrentToken->Next && CurrentToken->Next->is(tok::l_paren) && + Left->Type == TT_ObjCMethodExpr) { // An ObjC method call is rarely followed by an open parenthesis. // FIXME: Do we incorrectly label ":" with this? StartsObjCMethodExpr = false; |

