This is the mail archive of the gcc@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: C++: Tag transparent binding contour


Mark Mitchell <mark@codesourcery.com> writes:

| On Tue, 2003-06-03 at 09:58, Jason Merrill wrote:
| > On 03 Jun 2003 17:59:43 +0200, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| > 
| > > Code copied from the C front-end have the notion of "tag-transparent
| > > binding contour", which means that a tag (in C++ speak, a user-defined type)
| > > declared/defined inside that binding contour propagates uplevel, as if
| > > that binding contour did not exist, until it reachs a
| > > non-tag-transparent one.
| > >
| > > That notion is not really useful for C++, and it can be derived from
| > > the categorization made by scope_kind.  
| > 
| > > The only place, in the C++ front-end, where a tag-transparent binding
| > > contour is created in maybe_push_cleanup_level, where I think it is
| > > unnecessary.  Comments?
| > 
| > Well, if we're in the middle of a block and we want to push a new binding
| > level in order to support cleanup semantics, we don't want that binding
| > level to interfere with name lookup. 
| 
| I thought we also used these for template-parameter scopes.  (Not that
| I'm sure that makes sense, mind you.)

I think we used to do something like that in pre 3.4 (or pre 3.3) code.
However, with the systematic use of scope_kind in 3.4 code, the notion
of tag-transparent code seems to have disappeared.  
A simple-minded grep reveals:

   void
   begin_template_parm_list ()
   {
     /* We use a non-tag-transparent scope here, which causes pushtag to
        put tags in this scope, rather than in the enclosing class or
        namespace scope.  This is the right thing, since we want
        TEMPLATE_DECLS, and not TYPE_DECLS for template classes.  For a
        global template class, push_template_decl handles putting the
        TEMPLATE_DECL into top-level scope.  For a nested template class,
        e.g.:

So, it appears that we need actually use a tag-transparent binding
contour for anything really decisive.

-- Gaby


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