------- Comment #4 from mark at codesourcery dot com 2006-07-23 16:48 ------- Subject: Re: [4.0/4.1/4.2 Regression] g++ emits bogus namespace DIE
drow at gcc dot gnu dot org wrote: > ------- Comment #3 from drow at gcc dot gnu dot org 2006-07-23 16:44 ------- > Subject: Re: [4.0/4.1/4.2 Regression] g++ emits bogus namespace DIE > > On Sun, Jul 23, 2006 at 03:59:58PM -0000, mark at codesourcery dot com wrote: >> If we're setting TYPE_CONTEXT to global_namespace, I think that's a C++ >> front end bug. Which type is getting set up like that? > > I was wrong; TYPE_CONTEXT looks OK. How about for DECLs? The same rule applies; DECL_CONTEXT should also be NULL_TREE for an entity in the global namespace. > (gdb) call debug_tree (decl.decl_minimal.context) > <namespace_decl 0x2aaaab00f000 :: public VOID file <built-in> line 0 > align 1 > > > > So, the variable is in the global namespace explicitly. Ugh. I'm not surprised that this works (in the C++ front end) since we have logic that basically equates NULL_TREE with global_namespace, for those situations in which we explicitly need to have a namespace around. However, the global_namespace should never end up as {DECL,TYPE}_CONTEXT of anything. So, I think you should reclassify this as a C++ front end bug. You're still free to fix it of course. :-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28460