FreeBSD/contrib/gcc/cp/name-lookup.c
/* We're about to leave current scope.  Pop the top of the stack of
   currently active scopes.  Return the enclosing scope, now active.  */
We're about to leave current scope.  Pop the top of the stack of
currently active scopes.  Return the enclosing scope, now active.
We ' re about to leave current scope . Pop the top of the stack of currently active scopes . Return the enclosing scope now active .
cxx_scope *
leave_scope (void)
{
  cxx_scope *scope = current_binding_level;
  if (scope->kind == sk_namespace && class_binding_level)
    current_binding_level = class_binding_level;
  if (NAMESPACE_LEVEL (global_namespace))
    gcc_assert (!global_scope_p (scope));
  if (ENABLE_SCOPE_CHECKING)
    {
      indent (--binding_depth);
      cxx_scope_debug (scope, input_line, "leave");
      if (is_class_level != (scope == class_binding_level))
	{
	  indent (binding_depth);
	  verbatim ("XXX is_class_level != (current_scope == class_scope)\n");
	}
      is_class_level = 0;
    }
#ifdef HANDLE_PRAGMA_VISIBILITY
  if (scope->has_visibility)
    pop_visibility ();
#endif
  current_binding_level = scope->level_chain;
  if (scope->kind != sk_namespace
      && scope->kind != sk_class)
    {
      scope->level_chain = free_binding_level;
      gcc_assert (!ENABLE_SCOPE_CHECKING
		  || scope->binding_depth == binding_depth);
      free_binding_level = scope;
    }
  if (scope->kind == sk_class)
    {
      class_binding_level = NULL;
      for (scope = current_binding_level; scope; scope = scope->level_chain)
	if (scope->kind == sk_class)
	  {
	    class_binding_level = scope;
	    break;
	  }
    }
  return current_binding_level;
}
cxx_scope * leave_scope ( void ) { cxx_scope * scope = current_binding_level ; if ( scope -> kind == sk_namespace && class_binding_level ) current_binding_level = class_binding_level ; if ( NAMESPACE_LEVEL ( global_namespace ) ) gcc_assert ( ! global_scope_p ( scope ) ) ; if ( ENABLE_SCOPE_CHECKING ) { indent ( -- binding_depth ) ; cxx_scope_debug ( scope , input_line , " " ) ; if ( is_class_level != ( scope == class_binding_level ) ) { indent ( binding_depth ) ; verbatim ( " \n " ) ; } is_class_level = 0 ; } #ifdef HANDLE_PRAGMA_VISIBILITY if ( scope -> has_visibility ) pop_visibility ( ) ; #endif current_binding_level = scope -> level_chain ; if ( scope -> kind != sk_namespace && scope -> kind != sk_class ) { scope -> level_chain = free_binding_level ; gcc_assert ( ! ENABLE_SCOPE_CHECKING || scope -> binding_depth == binding_depth ) ; free_binding_level = scope ; } if ( scope -> kind == sk_class ) { class_binding_level = NULL ; for ( scope = current_binding_level ; scope ; scope = scope -> level_chain ) if ( scope -> kind == sk_class ) { class_binding_level = scope ; break ; } } return current_binding_level ; }
We're about to leave current scope.
We ' re about to leave current scope .
/* We cannot leave a scope, if there are none left.  */ /* Move one nesting level up.  */ /* Namespace-scopes are left most probably temporarily, not
     completely; they can be reopened later, e.g. in namespace-extension
     or any name binding activity that requires us to resume a
     namespace.  For classes, we cache some binding levels.  For other
     scopes, we just make the structure available for reuse.  */ /* Find the innermost enclosing class scope, and reset
     CLASS_BINDING_LEVEL appropriately.  */