Refix for diagnosis on expected expressions.

This commit is contained in:
acqn 2024-01-10 04:48:27 +08:00
parent 8aa59e4af3
commit 2564aaa12c
3 changed files with 4 additions and 1 deletions

View File

@ -1408,7 +1408,7 @@ static void Primary (ExprDesc* E)
} else {
/* Let's see if this is a C99-style declaration */
DeclSpec Spec;
ParseDeclSpec (&Spec, TS_DEFAULT_TYPE_INT, SC_AUTO);
ParseDeclSpec (&Spec, TS_DEFAULT_TYPE_NONE, SC_AUTO);
if ((Spec.Flags & DS_TYPE_MASK) != DS_NONE) {
Error ("Mixed declarations and code are not supported in cc65");

View File

@ -3,6 +3,8 @@
int enum { a } x;
inline enum { b };
_Static_assert();
int main(void)
{
return 0;

View File

@ -1,3 +1,4 @@
bug1889-missing-identifier.c:3: Error: Identifier or ';' expected after declaration specifiers
bug1889-missing-identifier.c:3: Warning: Implicit 'int' is an obsolete feature
bug1889-missing-identifier.c:4: Error: Declaration specifier or identifier expected
bug1889-missing-identifier.c:6: Error: Expression expected