diff options
author | Daniel Jasper <djasper@google.com> | 2014-03-11 11:03:26 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-03-11 11:03:26 +0000 |
commit | 8f59ae537c1453f167198db04af0ed609b1b696e (patch) | |
tree | ea8a7c36beb67709a00e50f49d714ba5b70bd7f6 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | e94a34cae25e91aab4d9461fbca1cef89ed5d928 (diff) | |
download | bcm5719-llvm-8f59ae537c1453f167198db04af0ed609b1b696e.tar.gz bcm5719-llvm-8f59ae537c1453f167198db04af0ed609b1b696e.zip |
clang-format: Avoid unnecessary break before lambda return type.
Before:
auto aaaaaaaa = [](int i, // break
int j)
-> int {
return fffffffffffffffffffffffffffffffffffffff(i * j);
};
After:
auto aaaaaaaa = [](int i, // break
int j) -> int {
return fffffffffffffffffffffffffffffffffffffff(i * j);
};
llvm-svn: 203562
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 ed5ce4a21e8..a96f1680db7 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -108,7 +108,8 @@ bool ContinuationIndenter::canBreak(const LineState &State) { // SomeParameter, OtherParameter).DoSomething( // ... // As they hide "DoSomething" and are generally bad for readability. - if (Previous.opensScope() && State.LowestLevelOnLine < State.StartOfLineLevel) + if (Previous.opensScope() && Previous.isNot(tok::l_brace) && + State.LowestLevelOnLine < State.StartOfLineLevel) return false; if (Current.isMemberAccess() && State.Stack.back().ContainsUnwrappedBuilder) return false; |