contrib/gcc-4.7/gcc/cp/mangle.c
/* If DECL is a template instance, return nonzero and, if
   TEMPLATE_INFO is non-NULL, set *TEMPLATE_INFO to its template info.
   Otherwise return zero.  */
If DECL is a template instance, return nonzero and, if
TEMPLATE_INFO is non-NULL, set *TEMPLATE_INFO to its template info.
Otherwise return zero.
If DECL is a template instance return nonzero and if TEMPLATE_INFO is non - NULL set * TEMPLATE_INFO to its template info . Otherwise return zero .
static int
decl_is_template_id (const tree decl, tree* const template_info)
{
  if (TREE_CODE (decl) == TYPE_DECL)
    {
      const tree type = TREE_TYPE (decl);
      if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_ID_P (type))
	{
	  if (template_info != NULL)
	    *template_info = TYPE_TEMPLATE_INFO (type);
	  return 1;
	}
    }
  else
    {
      if (DECL_LANG_SPECIFIC (decl) != NULL
	  && DECL_USE_TEMPLATE (decl)
	  && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))
	  && TREE_CODE (decl) != TEMPLATE_DECL)
	{
	  if (template_info != NULL)
	    *template_info = DECL_TEMPLATE_INFO (decl);
	  return 1;
	}
    }
  return 0;
}
static int decl_is_template_id ( const tree decl , tree * const template_info ) { if ( TREE_CODE ( decl ) == TYPE_DECL ) { const tree type = TREE_TYPE ( decl ) ; if ( CLASS_TYPE_P ( type ) && CLASSTYPE_TEMPLATE_ID_P ( type ) ) { if ( template_info != NULL ) * template_info = TYPE_TEMPLATE_INFO ( type ) ; return 1 ; } } else { if ( DECL_LANG_SPECIFIC ( decl ) != NULL && DECL_USE_TEMPLATE ( decl ) && PRIMARY_TEMPLATE_P ( DECL_TI_TEMPLATE ( decl ) ) && TREE_CODE ( decl ) != TEMPLATE_DECL ) { if ( template_info != NULL ) * template_info = DECL_TEMPLATE_INFO ( decl ) ; return 1 ; } } return 0 ; }
If DECL is a template instance, return nonzero and, if
TEMPLATE_INFO is non-NULL, set *TEMPLATE_INFO to its template info.
If DECL is a template instance return nonzero and if TEMPLATE_INFO is non - NULL set * TEMPLATE_INFO to its template info .
/* TYPE_DECLs are handled specially.  Look at its type to decide
	 if this is a template instantiation.  */ /* For a templated TYPE_DECL, the template info is hanging
	       off the type.  */ /* Check if this is a primary template.  */ /* For most templated decls, the template info is hanging
	       off the decl.  */ /* It's not a template id.  */