From: ceriel Date: Wed, 14 Oct 1992 10:48:27 +0000 (+0000) Subject: Fixed scope bug for structures: a(struct S *p) { struct S { int i; }; p->i ... X-Git-Tag: release-5-5~393 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=50db0a36433b6725047e7b62b8ad4c8334c7a0e0;p=ack.git Fixed scope bug for structures: a(struct S *p) { struct S { int i; }; p->i ... should work --- diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index 939622da0..5c2083e5c 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -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. */