[cfe-commits] [PATCH] PR7606: Diagnostic for ',' instead of '; ' at the end of a statement

Ahmed Bougacha ahmed.bougacha at gmail.com
Sat Sep 1 07:48:38 PDT 2012


Hello, this small patch improves the diagnostic for a typo of ','
instead of ';' at the end of a statement.

% cat t.c
int foo() {
  return 42,
}

Now yields the following :

% clang -fsyntax-only t.c
t.c:2:12: error: expected ';' at end of statement
  return 42,
           ^
           ;
1 error generated.

Whereas it previously led to :

% clang -fsyntax-only t.c

t.c:3:1: error: expected expression
}
^
t.c:3:2: error: expected '}'
}
 ^
t.c:1:11: note: to match this '{'
int foo() {
          ^
2 errors generated.

--
Amaury de la Vieuville
Ahmed Bougacha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR7606.patch
Type: application/octet-stream
Size: 3146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120901/48a98889/attachment.obj>


More information about the cfe-commits mailing list