Before:
SomeLoooooooooooooooooooooooooogType operator>
>(const SomeLooooooooooooooooooooooooogType &other);
SomeLoooooooooooooooooooooooooogType // break
operator>>(const SomeLooooooooooooooooooooooooogType &other);
After:
SomeLoooooooooooooooooooooooooogType
operator>>(const SomeLooooooooooooooooooooooooogType &other);
SomeLoooooooooooooooooooooooooogType // break
operator>>(const SomeLooooooooooooooooooooooooogType &other);
This fixes llvm.org/PR16328.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189450
91177308-0d34-0410-b5e6-
96231b3b80d8
if (CurrentToken->isOneOf(tok::star, tok::amp))
CurrentToken->Type = TT_PointerOrReference;
consumeToken();
+ if (CurrentToken->Previous->Type == TT_BinaryOperator)
+ CurrentToken->Previous->Type = TT_OverloadedOperator;
}
if (CurrentToken) {
CurrentToken->Type = TT_OverloadedOperatorLParen;
Right.is(tok::question))
return true;
if (Right.Type == TT_RangeBasedForLoopColon ||
- Right.Type == TT_OverloadedOperatorLParen)
+ Right.Type == TT_OverloadedOperatorLParen ||
+ Right.Type == TT_OverloadedOperator)
return false;
if (Left.Type == TT_RangeBasedForLoopColon)
return true;
// Treat overloaded operators like other functions.
verifyFormat("SomeLoooooooooooooooooooooooooogType\n"
"operator>(const SomeLoooooooooooooooooooooooooogType &other);");
+ verifyFormat("SomeLoooooooooooooooooooooooooogType\n"
+ "operator>>(const SomeLooooooooooooooooooooooooogType &other);");
verifyGoogleFormat(
"SomeLoooooooooooooooooooooooooooooogType operator<<(\n"
" const SomeLooooooooogType &a, const SomeLooooooooogType &b);");