[Bug c++/19073] cp_binding_level::names not returning all decls

sstrasser at systemhaus-gruppe dot de gcc-bugzilla@gcc.gnu.org
Mon Dec 20 03:42:00 GMT 2004


------- Additional Comments From sstrasser at systemhaus-gruppe dot de  2004-12-20 03:42 -------
ok, I took a closer look at this.
we all agree that type_decls(even c++ implicit ones) should be in
cp_binding_level::names, don't we?

decls get added to this list by name-lookup.c add_decl_to_level(), which gets
called by name-lookup.c:pushdecl()
pushdecl() checks if there is already a binding for the decl(via
namespace_binding()).
if there is(which is the case for the implicit type decls in current version),
it only calls add_decl_to_level() under certain circumstances, one of these is:
not being a TYPE_DECL.

in gcc version 3.3.4(which doesn't have this problem) namespace_binding()
returns 0, there is no binding, in current CVS there is.
so, why is this?

because of these lines in name-lookup.c:set_identifier_type_value_with_scope:
	  if (binding->value)
	    supplement_binding (binding, decl);
	  else
	    binding->value = decl;

I understand what they're doing but I don't understand why they are at this
point and were introduced in decl.c version 1.1114.
the cvs log message doesn't contain anything that's useful to me either.
why are these lines there? before this there was no assignment to binding->value
at all.

Thanks for your help

-- 


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



More information about the Gcc-bugs mailing list