This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28460] [4.0/4.1/4.2 Regression] g++ emits bogus namespace DIE
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jul 2006 20:17:51 -0000
- Subject: [Bug c++/28460] [4.0/4.1/4.2 Regression] g++ emits bogus namespace DIE
- References: <bug-28460-3264@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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