forked from OSchip/llvm-project
clang-format: Don't break in the middle of ">>".
Before: zzzzzzzzzz = bbbbbbbbbbbbbbbbb > > aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa); After: zzzzzzzzzz = bbbbbbbbbbbbbbbbb >> aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa); This fixes llvm.org/PR19731. llvm-svn: 208672
This commit is contained in:
parent
b7a7e55dc5
commit
0a1e5ace26
|
@ -1702,11 +1702,11 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
|
|||
if (Right.Type == TT_CtorInitializerComma &&
|
||||
Style.BreakConstructorInitializersBeforeComma)
|
||||
return true;
|
||||
if (Right.Type == TT_BinaryOperator && Style.BreakBeforeBinaryOperators)
|
||||
return true;
|
||||
if (Left.is(tok::greater) && Right.is(tok::greater) &&
|
||||
Left.Type != TT_TemplateCloser)
|
||||
return false;
|
||||
if (Right.Type == TT_BinaryOperator && Style.BreakBeforeBinaryOperators)
|
||||
return true;
|
||||
if (Left.Type == TT_ArrayInitializerLSquare)
|
||||
return true;
|
||||
return (Left.isBinaryOperator() && Left.isNot(tok::lessless) &&
|
||||
|
|
|
@ -3083,6 +3083,12 @@ TEST_F(FormatTest, ExpressionIndentationBreakingBeforeOperators) {
|
|||
verifyFormat("return boost::fusion::at_c<0>(iiii).second\n"
|
||||
" == boost::fusion::at_c<1>(iiii).second;",
|
||||
Style);
|
||||
|
||||
Style.ColumnLimit = 60;
|
||||
verifyFormat("zzzzzzzzzz\n"
|
||||
" = bbbbbbbbbbbbbbbbb\n"
|
||||
" >> aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa);",
|
||||
Style);
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, ConstructorInitializers) {
|
||||
|
|
Loading…
Reference in New Issue