Fixed scope bug for structures: a(struct S *p) { struct S { int i; }; p->i ...
authorceriel <none@none>
Wed, 14 Oct 1992 10:48:27 +0000 (10:48 +0000)
committerceriel <none@none>
Wed, 14 Oct 1992 10:48:27 +0000 (10:48 +0000)
should work

lang/cem/cemcom.ansi/struct.c

index 939622d..5c2083e 100644 (file)
@@ -188,7 +188,10 @@ declare_struct(fund, idf, tpp)
        if (tg
            && tg->tg_type->tp_size < 0
            && tg->tg_type->tp_fund == fund
-           && tg->tg_level == level) {
+           && (tg->tg_level == level
+               || (level >= L_FORMAL2
+                   && level <= L_LOCAL
+                   && tg->tg_level == L_FORMAL2))) {
                /*      An unfinished declaration has preceded it.
                        We just fill in the answer.
                 */