diff options
author | Daniel Jasper <djasper@google.com> | 2017-04-24 14:28:49 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2017-04-24 14:28:49 +0000 |
commit | cab4617132b0342d1774ff71dcbd16fde2409bd4 (patch) | |
tree | cab14e45a7235a47d84e223e9a2ea865de70a087 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 9111cd950d2ffb50a20e0c8680d24cb4bcc105ad (diff) | |
download | bcm5719-llvm-cab4617132b0342d1774ff71dcbd16fde2409bd4.tar.gz bcm5719-llvm-cab4617132b0342d1774ff71dcbd16fde2409bd4.zip |
clang-format: Fix bad corner case in formatting of function types.
Before:
std::function<
LoooooooooooongTemplatedType<SomeType>*(
LooooooooooooooooooooongType
type)>
function;
After:
std::function<
LoooooooooooongTemplatedType<
SomeType>*(
LooooooooooooooooongType type)>
function;
clang-format generally avoids having lines like "SomeType>*(" as they
lead to parameter lists that don't belong together to be aligned. However, in
case it is better than the alternative, which can even be violating the column
limit.
llvm-svn: 301182
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 73ae10a29f8..3adb72c11da 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -792,7 +792,8 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, if (Previous && Previous->is(tok::question)) State.Stack.back().QuestionColumn = State.Column; } - if (!Current.opensScope() && !Current.closesScope()) + if (!Current.opensScope() && !Current.closesScope() && + !Current.is(TT_PointerOrReference)) State.LowestLevelOnLine = std::min(State.LowestLevelOnLine, Current.NestingLevel); if (Current.isMemberAccess()) |