This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [mainline] C++ PATCH: Tidy name hiding


On Fri, 2003-08-29 at 15:10, Gabriel Dos Reis wrote:
> Mark, 
> 
> with your recent fix
> 
> 
>    2003-08-19  Mark Mitchell  <mark@codesourcery.com>
>            PR c++/11036
>            * cp-tree.h (add_binding): Add prototype.
> 
> The comment for add_binding
> 
>  /* ID is already bound in the current scope.  But, DECL is an
>     additional binding for ID in the same scope.  This is the `struct
>     stat' hack whereby a non-typedef class-name or enum-name can be
>     bound at the same level as some other kind of entity.  It's the
>     responsibility of the caller to check that inserting this name is
>     valid here.  Returns nonzero if the new binding was successful.  */
> 
> went a bit out-of-date since the "id" parameter became "binding".
> This patch improves on the comment by adding more reference to the
> standard.  I move it to the name-lookup module, where it belongs to.
> (That contributes to splitting cp/decl.c project)
> 
> 
> Also, since that function is actually hiding a declaration for a name,
> I renamed it to cxx_binding_hide_name.

I like everything in your patch, except the change of name.

The "hide_name" name makes me think that somehow the name is going to be
hidden, which it's not -- it's just that the type binding will require
an elaborated-type-specifier.

I actually think add_binding is OK, but supplement_binding might be
better?

Thanks,

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]