diff options
author | Daniel Jasper <djasper@google.com> | 2015-06-05 13:18:09 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-06-05 13:18:09 +0000 |
commit | 6f2b88a39838fa46b222e506c9407f1cc31feeb3 (patch) | |
tree | 61a1bec3b1db472003d537983987a0e4ec693203 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | f6a1312f1b30a335889f74d92e5ce5e5a6970f4a (diff) | |
download | bcm5719-llvm-6f2b88a39838fa46b222e506c9407f1cc31feeb3.tar.gz bcm5719-llvm-6f2b88a39838fa46b222e506c9407f1cc31feeb3.zip |
clang-format: More eagerly wrap trailing return types.
Before:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
.aaaaaaaa());
After:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t)
-> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());
Also add a test case for a difficult template parsing case I stumbled accross.
Needs fixing.
llvm-svn: 239149
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 10a716c551b..91bc64b2b8b 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -329,7 +329,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, State.Column > getNewLineColumn(State)) State.Stack.back().ContainsUnwrappedBuilder = true; - if (Current.is(TT_LambdaArrow)) + if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java) State.Stack.back().NoLineBreak = true; if (Current.isMemberAccess() && Previous.is(tok::r_paren) && (Previous.MatchingParen && |