Skip to content

Commit

Permalink
Revert "[clang-format] Fix align consecutive declarations over functi…
Browse files Browse the repository at this point in the history
…on pointers"

This reverts commit a84e0b4.

Fixes llvm#68079.

(cherry picked from commit 7bc1031)
  • Loading branch information
owenca authored and tru committed Oct 27, 2023
1 parent 1f6d35b commit fb62a20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Format/WhitespaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ void WhitespaceManager::alignConsecutiveDeclarations() {
AlignTokens(
Style,
[](Change const &C) {
if (C.Tok->isOneOf(TT_FunctionDeclarationName, TT_FunctionTypeLParen))
if (C.Tok->is(TT_FunctionDeclarationName))
return true;
if (C.Tok->isNot(TT_StartOfName))
return false;
Expand Down
10 changes: 0 additions & 10 deletions clang/unittests/Format/FormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
"const unsigned int *d;\n"
"Const unsigned int &e;\n"
"const unsigned int &f;\n"
"int *f1(int *a, int &b, int &&c);\n"
"double *(*f2)(int *a, double &&b);\n"
"const unsigned &&g;\n"
"Const unsigned h;",
Style);
Expand Down Expand Up @@ -2106,8 +2104,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
"const unsigned int* d;\n"
"Const unsigned int& e;\n"
"const unsigned int& f;\n"
"int* f1(int* a, int& b, int&& c);\n"
"double* (*f2)(int* a, double&& b);\n"
"const unsigned&& g;\n"
"Const unsigned h;",
Style);
Expand All @@ -2133,8 +2129,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
"const unsigned int *d;\n"
"Const unsigned int& e;\n"
"const unsigned int& f;\n"
"int *f1(int *a, int& b, int&& c);\n"
"double *(*f2)(int *a, double&& b);\n"
"const unsigned g;\n"
"Const unsigned h;",
Style);
Expand Down Expand Up @@ -2175,8 +2169,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
"const unsigned int* d;\n"
"Const unsigned int & e;\n"
"const unsigned int & f;\n"
"int* f1(int* a, int & b, int && c);\n"
"double* (*f2)(int* a, double && b);\n"
"const unsigned && g;\n"
"Const unsigned h;",
Style);
Expand All @@ -2202,8 +2194,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
"const unsigned int * d;\n"
"Const unsigned int &e;\n"
"const unsigned int &f;\n"
"int * f1(int * a, int &b, int &&c);\n"
"double * (*f2)(int * a, double &&b);\n"
"const unsigned &&g;\n"
"Const unsigned h;",
Style);
Expand Down

0 comments on commit fb62a20

Please sign in to comment.