summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-05 10:04:31 +0000
committerDaniel Jasper <djasper@google.com>2013-09-05 10:04:31 +0000
commit9a8d48b5e1df1c459625bef47d36424bd25c7efb (patch)
treee09792102e7b727d2a2ecb4f35d5f938b989f288 /clang/lib/Format/ContinuationIndenter.cpp
parent9fe0e8dacdb36520bd93ed720afd4ce045931a44 (diff)
downloadbcm5719-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/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index f9219cbaf75..c47d799f445 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -267,7 +267,8 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline,
State.Column = State.Stack.back().Indent;
State.Stack.back().ColonPos = State.Column + Current.CodePointCount;
}
- } else if (Current.is(tok::l_square) && Current.Type != TT_ObjCMethodExpr) {
+ } else if (Current.is(tok::l_square) && Current.Type != TT_ObjCMethodExpr &&
+ Current.Type != TT_LambdaLSquare) {
if (State.Stack.back().StartOfArraySubscripts != 0)
State.Column = State.Stack.back().StartOfArraySubscripts;
else
OpenPOWER on IntegriCloud