Skip to content

Commit 8f8693a

Browse files
committed
Address review comment
1 parent 5ecb2de commit 8f8693a

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,6 @@ def ext_consteval_if : ExtWarn<
703703
def warn_cxx20_compat_consteval_if : Warning<
704704
"consteval if is incompatible with C++ standards before C++23">,
705705
InGroup<CXXPre23Compat>, DefaultIgnore;
706-
def err_extraneous_trailing_comma : Error<
707-
"extraneous trailing comma">;
708706

709707
def ext_init_statement : ExtWarn<
710708
"'%select{if|switch}0' initialization statements are a C++17 extension">,

clang/lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,8 +2238,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
22382238
RunSignatureHelp();
22392239
LHS = ExprError();
22402240
} else if (!HasError && HasTrailingComma) {
2241-
// FIXME: add a FIXIT to remove the trailing comma.
2242-
Diag(Tok, diag::err_extraneous_trailing_comma);
2241+
Diag(Tok, diag::err_expected_expression);
22432242
} else if (LHS.isInvalid()) {
22442243
for (auto &E : ArgExprs)
22452244
Actions.CorrectDelayedTyposInExpr(E);

clang/test/Parser/recovery.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,6 @@ class :: : {} a; // expected-error {{expected identifier}} expected-error {{exp
219219
namespace GH125225 {
220220
void func(int);
221221
void k() {
222-
func(1, ); // expected-error {{extraneous trailing comma}}
222+
func(1, ); // expected-error {{expected expression}}
223223
}
224224
}

0 commit comments

Comments
 (0)