forked from OSchip/llvm-project
Fix dereference formatting in for-loops.
Before: for (char **a = b; * a; ++a) {} After: for (char **a = b; *a; ++a) {} llvm-svn: 177037
This commit is contained in:
parent
140cd84155
commit
ae9076457e
|
@ -661,7 +661,7 @@ private:
|
|||
return TT_PointerOrReference;
|
||||
|
||||
if (PrevToken->isOneOf(tok::l_paren, tok::l_square, tok::l_brace,
|
||||
tok::comma, tok::kw_return, tok::colon,
|
||||
tok::comma, tok::semi, tok::kw_return, tok::colon,
|
||||
tok::equal) ||
|
||||
PrevToken->Type == TT_BinaryOperator ||
|
||||
PrevToken->Type == TT_UnaryOperator || PrevToken->Type == TT_CastRParen)
|
||||
|
|
|
@ -1919,6 +1919,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
|||
"const char *const p = reinterpret_cast<const char *const>(q);");
|
||||
verifyIndependentOfContext("A<int **, int **> a;");
|
||||
verifyIndependentOfContext("void f(int *a = d * e, int *b = c * d);");
|
||||
verifyFormat("for (char **a = b; *a; ++a) {\n}");
|
||||
|
||||
verifyFormat(
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
|
|
Loading…
Reference in New Issue