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.
  • Loading branch information
owenca committed Oct 24, 2023
1 parent 97f1db2 commit 7bc1031
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
Expand Up @@ -980,7 +980,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
Expand Up @@ -2033,8 +2033,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 @@ -2080,8 +2078,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 @@ -2107,8 +2103,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 @@ -2149,8 +2143,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 @@ -2176,8 +2168,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 7bc1031

Please sign in to comment.