================
@@ -2237,6 +2237,9 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
             if (PP.isCodeCompletionReached() && !CalledSignatureHelp)
               RunSignatureHelp();
             LHS = ExprError();
+          } else if (!HasError && HasTrailingComma) {
+            // FIXME: add a FIXIT to remove the trailing comma.
+            Diag(Tok, diag::err_extraneous_trailing_comma);
----------------
hokein wrote:

Reused the existing err_expected_expression.

I initially thought that the new `err_extraneous_trailing_comma` provided a 
clearer message than `err_expected_expression`, but it only applies to a 
specific test case (the one added in this PR).

For other cases, such as `function2Arg(1, );`, the new diagnostic is incorrect.

https://github.com/llvm/llvm-project/pull/125232
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to