From 9a8d48b5e1df1c459625bef47d36424bd25c7efb Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 5 Sep 2013 10:04:31 +0000 Subject: 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 --- clang/lib/Format/TokenAnnotator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format/TokenAnnotator.cpp') 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; -- cgit v1.2.3