clang-format: Make it more expensive to break template parameters.
In particular, make it more expensive than breaking after the return type of a function definition/declaration. Before: template <typename T> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa< T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa); After: template <typename T> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa); llvm-svn: 260497
This commit is contained in:
parent
7f550f3dbb
commit
88db760e4b
|
@ -59,7 +59,7 @@ private:
|
|||
|
||||
FormatToken *Left = CurrentToken->Previous;
|
||||
Left->ParentBracket = Contexts.back().ContextKind;
|
||||
ScopedContextCreator ContextCreator(*this, tok::less, 10);
|
||||
ScopedContextCreator ContextCreator(*this, tok::less, 12);
|
||||
|
||||
// If this angle is in the context of an expression, we need to be more
|
||||
// hesitant to detect it as opening template parameters.
|
||||
|
|
|
@ -3850,6 +3850,11 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
|
|||
"typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa\n"
|
||||
"aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
" bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}");
|
||||
verifyGoogleFormat(
|
||||
"template <typename T>\n"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
|
||||
"aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);");
|
||||
|
||||
FormatStyle Style = getLLVMStyle();
|
||||
Style.PointerAlignment = FormatStyle::PAS_Left;
|
||||
|
|
Loading…
Reference in New Issue