forked from OSchip/llvm-project
clang-format: Prefer breaking after return type over template param
Before: typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa< aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa, bool *aa) {} After: typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( bool *aaaaaaaaaaaaaaaaaa, bool *aa) {} llvm-svn: 215693
This commit is contained in:
parent
497d9fdcf8
commit
ea79ea1627
|
@ -1441,6 +1441,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|||
return 110;
|
||||
if (Right.is(tok::r_brace))
|
||||
return 1;
|
||||
if (Left.Type == TT_TemplateOpener)
|
||||
return 100;
|
||||
if (Left.opensScope())
|
||||
return Left.ParameterCount > 1 ? Style.PenaltyBreakBeforeFirstCallParameter
|
||||
: 19;
|
||||
|
|
|
@ -3428,6 +3428,10 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
|
|||
" int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1);");
|
||||
verifyFormat("aaaaaaaaaaaaaaaaaaaaaa\n"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaa = 1);");
|
||||
verifyGoogleFormat(
|
||||
"typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa\n"
|
||||
"aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
" bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, TrailingReturnType) {
|
||||
|
|
Loading…
Reference in New Issue