commit 44123dfb36d1c0ba6b428d89a870679f4f7ff86e
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed Sep 28 11:32:54 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Wed Sep 28 11:32:54 2016 +0200

    [cc1] Fix redeclaration of tags
    
    A tag can be redeclared if the context of both declarations is different.

diff --git a/cc1/decl.c b/cc1/decl.c
index 20df8fd..05677ab 100644
--- 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;
 

Reply via email to