This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Candidate fix for PR 15007
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 03 May 2004 11:04:50 -0700
- Subject: Re: Candidate fix for PR 15007
- References: <873c6ku3c4.fsf@egil.codesourcery.com>
Zack Weinberg <zack@codesourcery.com> writes:
> It seems to me that the most straightforward way to fix PR 15007 is to
> avoid generating a TRANSLATION_UNIT_DECL at all until we're done
> parsing the entire translation unit. This mirrors what is done with
> BLOCK nodes - we create them only when the scope is popped.
> Fortunately, DECL_FILE_SCOPE_P can already handle this, so the change
> is limited to c-decl.c.
This isn't exactly what your patch does. If I'm reading it right, it
defers creating the TRANSLATION_UNIT_DECL until the first global
declaration is seen. The approach you described would have been
trouble, but the one actually implemented looks like it would work.
--
- Geoffrey Keating <geoffk@geoffk.org>