Skip to content

Commit 7bc1031

Browse files
committed
Revert "[clang-format] Fix align consecutive declarations over function pointers"
This reverts commit a84e0b4. Fixes llvm#68079.
1 parent 97f1db2 commit 7bc1031

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
@@ -980,7 +980,7 @@ void WhitespaceManager::alignConsecutiveDeclarations() {
980980
AlignTokens(
981981
Style,
982982
[](Change const &C) {
983-
if (C.Tok->isOneOf(TT_FunctionDeclarationName, TT_FunctionTypeLParen))
983+
if (C.Tok->is(TT_FunctionDeclarationName))
984984
return true;
985985
if (C.Tok->isNot(TT_StartOfName))
986986
return false;

clang/unittests/Format/FormatTest.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,8 +2033,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
20332033
"const unsigned int *d;\n"
20342034
"Const unsigned int &e;\n"
20352035
"const unsigned int &f;\n"
2036-
"int *f1(int *a, int &b, int &&c);\n"
2037-
"double *(*f2)(int *a, double &&b);\n"
20382036
"const unsigned &&g;\n"
20392037
"Const unsigned h;",
20402038
Style);
@@ -2080,8 +2078,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
20802078
"const unsigned int* d;\n"
20812079
"Const unsigned int& e;\n"
20822080
"const unsigned int& f;\n"
2083-
"int* f1(int* a, int& b, int&& c);\n"
2084-
"double* (*f2)(int* a, double&& b);\n"
20852081
"const unsigned&& g;\n"
20862082
"Const unsigned h;",
20872083
Style);
@@ -2107,8 +2103,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21072103
"const unsigned int *d;\n"
21082104
"Const unsigned int& e;\n"
21092105
"const unsigned int& f;\n"
2110-
"int *f1(int *a, int& b, int&& c);\n"
2111-
"double *(*f2)(int *a, double&& b);\n"
21122106
"const unsigned g;\n"
21132107
"Const unsigned h;",
21142108
Style);
@@ -2149,8 +2143,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21492143
"const unsigned int* d;\n"
21502144
"Const unsigned int & e;\n"
21512145
"const unsigned int & f;\n"
2152-
"int* f1(int* a, int & b, int && c);\n"
2153-
"double* (*f2)(int* a, double && b);\n"
21542146
"const unsigned && g;\n"
21552147
"Const unsigned h;",
21562148
Style);
@@ -2176,8 +2168,6 @@ TEST_F(FormatTest, SeparatePointerReferenceAlignment) {
21762168
"const unsigned int * d;\n"
21772169
"Const unsigned int &e;\n"
21782170
"const unsigned int &f;\n"
2179-
"int * f1(int * a, int &b, int &&c);\n"
2180-
"double * (*f2)(int * a, double &&b);\n"
21812171
"const unsigned &&g;\n"
21822172
"Const unsigned h;",
21832173
Style);

0 commit comments

Comments
 (0)