FreeBSD/contrib/gcc/cp/name-lookup.c
/* Insert another USING_DECL into the current binding level, returning
   this declaration. If this is a redeclaration, do nothing, and
   return NULL_TREE if this not in namespace scope (in namespace
   scope, a using decl might extend any previous bindings).  */
Insert another USING_DECL into the current binding level, returning
this declaration. If this is a redeclaration, do nothing, and
return NULL_TREE if this not in namespace scope (in namespace
scope, a using decl might extend any previous bindings).
Insert another USING_DECL into the current binding level returning this declaration . If this is a redeclaration do nothing and return NULL_TREE if this not in namespace scope ( in namespace scope a using decl might extend any previous bindings ) .
static tree
push_using_decl (tree scope, tree name)
{
  tree decl;
  timevar_push (TV_NAME_LOOKUP);
  gcc_assert (TREE_CODE (scope) == NAMESPACE_DECL);
  gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
  for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl))
    if (USING_DECL_SCOPE (decl) == scope && DECL_NAME (decl) == name)
      break;
  if (decl)
    POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP,
			    namespace_bindings_p () ? decl : NULL_TREE);
  decl = build_lang_decl (USING_DECL, name, NULL_TREE);
  USING_DECL_SCOPE (decl) = scope;
  TREE_CHAIN (decl) = current_binding_level->usings;
  current_binding_level->usings = decl;
  POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
static tree push_using_decl ( tree scope , tree name ) { tree decl ; timevar_push ( TV_NAME_LOOKUP ) ; gcc_assert ( TREE_CODE ( scope ) == NAMESPACE_DECL ) ; gcc_assert ( TREE_CODE ( name ) == IDENTIFIER_NODE ) ; for ( decl = current_binding_level -> usings ; decl ; decl = TREE_CHAIN ( decl ) ) if ( USING_DECL_SCOPE ( decl ) == scope && DECL_NAME ( decl ) == name ) break ; if ( decl ) POP_TIMEVAR_AND_RETURN ( TV_NAME_LOOKUP , namespace_bindings_p ( ) ? decl : NULL_TREE ) ; decl = build_lang_decl ( USING_DECL , name , NULL_TREE ) ; USING_DECL_SCOPE ( decl ) = scope ; TREE_CHAIN ( decl ) = current_binding_level -> usings ; current_binding_level -> usings = decl ; POP_TIMEVAR_AND_RETURN ( TV_NAME_LOOKUP , decl ) ; }
Insert another USING_DECL into the current binding level, returning
this declaration.
Insert another USING_DECL into the current binding level returning this declaration .