[Bug c++/28460] [4.0/4.1/4.2 Regression] g++ emits bogus namespace DIE

mark at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Sun Jul 23 20:17:00 GMT 2006



------- Comment #8 from mark at codesourcery dot com  2006-07-23 20:17 -------
Subject: Re:  [4.0/4.1/4.2 Regression] g++ emits bogus namespace
 DIE

drow at gcc dot gnu dot org wrote:

> It did so by introducing FROB_CONTEXT.  Right now, FROB_CONTEXT is used at a
> number of places which set DECL_CONTEXT, but not at a number of others (13
> with, 55 without).  Some of those without obviously don't need it.  Others are
> less clear.  But after going through them all, I think only two need it.  The
> obvious patch works for my testcase.  I will regression test it more
> thoroughly.

It sounds to me like the best thing might be to have:

  #define SET_CP_DECL_CONTEXT(NODE, CONTEXT) \
    (DECL_CONTEXT (NODE) = FROB_CONTEXT (NODE, CONTEXT))

and use that everywhere.  I'd rather not be clever about where we might
have to use it and where we might not.

(IMO, the ideal representation would have global_namespace for
DECL_CONTEXT -- but that's not a change we can make without affecting
the middle end, as you've noticed, so I think having
{SET_,}CP_DECL_CONTEXT to insulate us would be a nice improvement.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28460



More information about the Gcc-bugs mailing list