scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 945fac774ed2588ee069a163f80e095fa2948ef9
parent a28ccde717c0ae7543a5f358fa10790d7177b6a7
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 21 Jul 2015 09:35:29 +0200

Fix grammar bug in enum declaration

Enum constants are initialized with constant expressions, not
with initializators.

Diffstat:
cc1/decl.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -396,11 +396,11 @@ enumdcl(void) if (yytoken != IDEN) unexpected(); if ((sym = install(NS_IDEN)) == NULL) - error("duplicated member '%s'", yytext); + error("'%s' redeclared as different kind of symbol", yytext); next(); sym->type = inttype; if (accept('=')) - initializer(sym); + constexpr(); sym->u.i = val++; if (!accept(',')) break;