summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-07-07 13:50:50 +0000
committerDaniel Jasper <djasper@google.com>2015-07-07 13:50:50 +0000
commitb9edcfb0183ae091833143b8ab8c4618e27797df (patch)
tree6121dd0b113c4db8410ebb54385d56a1d38334ff /clang/lib/Format/TokenAnnotator.cpp
parent7c04eae204867d136468f24339912827d773f1ca (diff)
downloadbcm5719-llvm-b9edcfb0183ae091833143b8ab8c4618e27797df.tar.gz
bcm5719-llvm-b9edcfb0183ae091833143b8ab8c4618e27797df.zip
clang-format: Don't wrap before the ] of a lambda introducer.
Before: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([= ](int iiiiiiiiiiii) { return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa; }); After: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=]( int iiiiiiiiiiii) { return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa; }); llvm-svn: 241583
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index f4b9c4eee9e..a3691570cdc 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2206,6 +2206,9 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
if (Right.is(tok::r_paren) || Right.is(TT_TemplateCloser))
return false;
+ if (Right.is(tok::r_square) && Right.MatchingParen &&
+ Right.MatchingParen->is(TT_LambdaLSquare))
+ return false;
// We only break before r_brace if there was a corresponding break before
// the l_brace, which is tracked by BreakBeforeClosingBrace.
OpenPOWER on IntegriCloud