Formatter: * and & are binary operators after ) and ].
llvm-svn: 172302
This commit is contained in:
parent
63a54eb766
commit
5dafd4a7ae
|
@ -969,7 +969,8 @@ private:
|
|||
Tok.Parent->Type == TT_CastRParen)
|
||||
return TT_UnaryOperator;
|
||||
|
||||
if (PrevToken.Tok.isLiteral() || NextToken.Tok.isLiteral() ||
|
||||
if (PrevToken.Tok.isLiteral() || PrevToken.Tok.is(tok::r_paren) ||
|
||||
PrevToken.Tok.is(tok::r_square) || NextToken.Tok.isLiteral() ||
|
||||
NextToken.Tok.is(tok::plus) || NextToken.Tok.is(tok::minus) ||
|
||||
NextToken.Tok.is(tok::plusplus) || NextToken.Tok.is(tok::minusminus) ||
|
||||
NextToken.Tok.is(tok::tilde) || NextToken.Tok.is(tok::exclaim) ||
|
||||
|
|
|
@ -1014,6 +1014,8 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
|||
verifyFormat("a * -b;");
|
||||
verifyFormat("a * ++b;");
|
||||
verifyFormat("a * --b;");
|
||||
verifyFormat("a[4] * b;");
|
||||
verifyFormat("f() * b;");
|
||||
verifyFormat("int *pa = (int *)&a;");
|
||||
|
||||
verifyFormat("InvalidRegions[*R] = 0;");
|
||||
|
|
Loading…
Reference in New Issue