shithub: scc

Download patch

ref: 2643bba93ce4239a2b1f79c82c983b42e871f389
parent: 92dfdb5b60c5f9b08fe3073fa8d3195b4acd6204
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Sep 28 07:32:54 EDT 2016

[cc1] Fix redeclaration of tags

A tag can be redeclared if the context of both declarations is different.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -519,7 +519,7 @@
 		return tp;
 	}
 
-	if (tp->prop & TDEFINED)
+	if (tp->prop & TDEFINED && sym->ctx == curctx)
 		error("redefinition of struct/union '%s'", sym->name);
 	tp->prop |= TDEFINED;