commit 44123dfb36d1c0ba6b428d89a870679f4f7ff86e
parent c72e4d06d0b6510f3dbb0ea05a15e83b0696262b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 28 Sep 2016 11:32:54 +0200
[cc1] Fix redeclaration of tags
A tag can be redeclared if the context of both declarations is different.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cc1/decl.c b/cc1/decl.c
@@ -519,7 +519,7 @@ structdcl(void)
return tp;
}
- if (tp->prop & TDEFINED)
+ if (tp->prop & TDEFINED && sym->ctx == curctx)
error("redefinition of struct/union '%s'", sym->name);
tp->prop |= TDEFINED;