зеркало из https://github.com/microsoft/clang-1.git
Fix dereference formatting in for-loops.
Before: for (char **a = b; * a; ++a) {} After: for (char **a = b; *a; ++a) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177037 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
96cead5137
Коммит
d3cf17b5f1
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче