shithub: scc

Download patch

ref: 945fac774ed2588ee069a163f80e095fa2948ef9
parent: a28ccde717c0ae7543a5f358fa10790d7177b6a7
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Jul 21 05:35:29 EDT 2015

Fix grammar bug in enum declaration

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

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -396,11 +396,11 @@
 		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;