[Bug c/57021] New: Better error message for * missing an expression or rather using a non-type as a cast
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Apr 21 07:21:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57021
Bug #: 57021
Summary: Better error message for * missing an expression or
rather using a non-type as a cast
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@gcc.gnu.org
Take:
int main(void)
{
int a;
(a*)0;
}
---- CUT ---
Right now we produce:
t.c:4:6: error: expected expression before ‘)’ token
(a*)0;
^
or for C++:
t.c:4:6: error: expected primary-expression before ‘)’ token
(a*)0;
^
t.c:4:7: error: expected ‘;’ before numeric constant
(a*)0;
^
---- CUT ----
Really we should say instead a is not a type. Yes this is a complex error
recovery issue but I think we should be able to figure it out.
More information about the Gcc-bugs
mailing list