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/ContinuationIndenter.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/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 3 |
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 |