FreeBSD/contrib/gcc/cp/name-lookup.c
/* The type TYPE is being declared.  If it is a class template, or a
   specialization of a class template, do any processing required and
   perform error-checking.  If IS_FRIEND is nonzero, this TYPE is
   being declared a friend.  B is the binding level at which this TYPE
   should be bound.

   Returns the TYPE_DECL for TYPE, which may have been altered by this
   processing.  */
The type TYPE is being declared.  If it is a class template, or a
specialization of a class template, do any processing required and
perform error-checking.  If IS_FRIEND is nonzero, this TYPE is
being declared a friend.  B is the binding level at which this TYPE
should be bound.

Returns the TYPE_DECL for TYPE, which may have been altered by this
processing.
The type TYPE is being declared . If it is a class template or a specialization of a class template do any processing required and perform error - checking . If IS_FRIEND is nonzero this TYPE is being declared a friend . B is the binding level at which this TYPE should be bound . Returns the TYPE_DECL for TYPE which may have been altered by this processing .
static tree
maybe_process_template_type_declaration (tree type, int is_friend,
					 cxx_scope *b)
{
  tree decl = TYPE_NAME (type);
  if (processing_template_parmlist)
    ;
  else if (b->kind == sk_namespace
	   && current_binding_level->kind != sk_namespace)
    ;
  else
    {
      gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE);
      if (processing_template_decl)
	{
	  tree name = DECL_NAME (decl);
	  decl = push_template_decl_real (decl, is_friend);
	  if (TREE_CODE (type) != ENUMERAL_TYPE
	      && !is_friend && b->kind == sk_template_parms
	      && b->level_chain->kind == sk_class)
	    {
	      finish_member_declaration (CLASSTYPE_TI_TEMPLATE (type));
	      if (!COMPLETE_TYPE_P (current_class_type))
		{
		  maybe_add_class_template_decl_list (current_class_type,
						      type, 0);
		  if (CLASSTYPE_NESTED_UTDS (current_class_type) == NULL)
		    CLASSTYPE_NESTED_UTDS (current_class_type) =
		      binding_table_new (SCOPE_DEFAULT_HT_SIZE);
		  binding_table_insert
		    (CLASSTYPE_NESTED_UTDS (current_class_type), name, type);
		}
	    }
	}
    }
  return decl;
}
static tree maybe_process_template_type_declaration ( tree type , int is_friend , cxx_scope * b ) { tree decl = TYPE_NAME ( type ) ; if ( processing_template_parmlist ) ; else if ( b -> kind == sk_namespace && current_binding_level -> kind != sk_namespace ) ; else { gcc_assert ( IS_AGGR_TYPE ( type ) || TREE_CODE ( type ) == ENUMERAL_TYPE ) ; if ( processing_template_decl ) { tree name = DECL_NAME ( decl ) ; decl = push_template_decl_real ( decl , is_friend ) ; if ( TREE_CODE ( type ) != ENUMERAL_TYPE && ! is_friend && b -> kind == sk_template_parms && b -> level_chain -> kind == sk_class ) { finish_member_declaration ( CLASSTYPE_TI_TEMPLATE ( type ) ) ; if ( ! COMPLETE_TYPE_P ( current_class_type ) ) { maybe_add_class_template_decl_list ( current_class_type , type , 0 ) ; if ( CLASSTYPE_NESTED_UTDS ( current_class_type ) == NULL ) CLASSTYPE_NESTED_UTDS ( current_class_type ) = binding_table_new ( SCOPE_DEFAULT_HT_SIZE ) ; binding_table_insert ( CLASSTYPE_NESTED_UTDS ( current_class_type ) , name , type ) ; } } } } return decl ; }
The type TYPE is being declared.
The type TYPE is being declared .
/* You can't declare a new template type in a template parameter
       list.  But, you can declare a non-template type:

	 template <class A*> struct S;

       is a forward-declaration of `A'.  */ /* If this new type is being injected into a containing scope,
       then it's not a template type.  */ /* This may change after the call to
	     push_template_decl_real, but we want the original value.  */ /* If the current binding level is the binding level for the
	     template parameters (see the comment in
	     begin_template_parm_list) and the enclosing level is a class
	     scope, and we're not looking at a friend, push the
	     declaration of the member class into the class scope.  In the
	     friend case, push_template_decl will already have put the
	     friend into global scope, if appropriate.  */ /*friend_p=*/ /* Put this UTD in the table of UTDs for the class.  */