summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-03-02 10:35:13 +0000
committerDaniel Jasper <djasper@google.com>2015-03-02 10:35:13 +0000
commite662316994ff7f90263c98e5213230fa7823e8d2 (patch)
tree66e40f00e5c730cd38e5a1133f79233774af72d0 /clang/lib/Format
parent63fbf10c32014cd88eb495d2eed49592972adbe6 (diff)
downloadbcm5719-llvm-e662316994ff7f90263c98e5213230fa7823e8d2.tar.gz
bcm5719-llvm-e662316994ff7f90263c98e5213230fa7823e8d2.zip
clang-format: Prefer wrapping a lambda's body over the lambda's return type.
Before: aaaaaaaaaaaaaaaaaaaaaa( [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; }); After: aaaaaaaaaaaaaaaaaaaaaa( [](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; }); llvm-svn: 230942
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 853a56b6a42..1688568c7b1 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1535,6 +1535,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
return Style.PenaltyReturnTypeOnItsOwnLine;
return 200;
}
+ if (Right.is(TT_TrailingReturnArrow))
+ return 110;
if (Left.is(tok::equal) && Right.is(tok::l_brace))
return 150;
if (Left.is(TT_CastRParen))
OpenPOWER on IntegriCloud