Skip to content

Commit fb62a20

Browse files
owencatru
authored andcommitted
Revert "[clang-format] Fix align consecutive declarations over function pointers"
This reverts commit a84e0b4. Fixes #68079. (cherry picked from commit 7bc1031)
1 parent 1f6d35b commit fb62a20

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

clang/lib/Format/WhitespaceManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ void WhitespaceManager::alignConsecutiveDeclarations() {
965965
AlignTokens(
966966
Style,
967967
[](Change const &C) {
968-
if (C.Tok->isOneOf(TT_FunctionDeclarationName, TT_FunctionTypeLParen))
968+
if (C.Tok->is(TT_FunctionDeclarationName))
969969
return true;
970970
if (C.Tok->isNot(TT_StartOfName))
971971
return false;

clang/unittests/Format/FormatTest.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,8 +2059,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
20592059
"const unsigned int *d;\n"
20602060
"Const unsigned int &e;\n"
20612061
"const unsigned int &f;\n"
2062-
"int *f1(int *a, int &b, int &&c);\n"
2063-
"double *(*f2)(int *a, double &&b);\n"
20642062
"const unsigned &&g;\n"
20652063
"Const unsigned h;",
20662064
Style);
@@ -2106,8 +2104,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21062104
"const unsigned int* d;\n"
21072105
"Const unsigned int& e;\n"
21082106
"const unsigned int& f;\n"
2109-
"int* f1(int* a, int& b, int&& c);\n"
2110-
"double* (*f2)(int* a, double&& b);\n"
21112107
"const unsigned&& g;\n"
21122108
"Const unsigned h;",
21132109
Style);
@@ -2133,8 +2129,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21332129
"const unsigned int *d;\n"
21342130
"Const unsigned int& e;\n"
21352131
"const unsigned int& f;\n"
2136-
"int *f1(int *a, int& b, int&& c);\n"
2137-
"double *(*f2)(int *a, double&& b);\n"
21382132
"const unsigned g;\n"
21392133
"Const unsigned h;",
21402134
Style);
@@ -2175,8 +2169,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21752169
"const unsigned int* d;\n"
21762170
"Const unsigned int & e;\n"
21772171
"const unsigned int & f;\n"
2178-
"int* f1(int* a, int & b, int && c);\n"
2179-
"double* (*f2)(int* a, double && b);\n"
21802172
"const unsigned && g;\n"
21812173
"Const unsigned h;",
21822174
Style);
@@ -2202,8 +2194,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
22022194
"const unsigned int * d;\n"
22032195
"Const unsigned int &e;\n"
22042196
"const unsigned int &f;\n"
2205-
"int * f1(int * a, int &b, int &&c);\n"
2206-
"double * (*f2)(int * a, double &&b);\n"
22072197
"const unsigned &&g;\n"
22082198
"Const unsigned h;",
22092199
Style);

0 commit comments

Comments
 (0)