FreeBSD/contrib/gcc/cp/parser.c
/* Update the DECL_SPECS to reflect the storage class indicated by
   KEYWORD.  */
Update the DECL_SPECS to reflect the storage class indicated by
KEYWORD.
Update the DECL_SPECS to reflect the storage class indicated by KEYWORD .
static void
cp_parser_set_storage_class (cp_parser *parser,
			     cp_decl_specifier_seq *decl_specs,
			     enum rid keyword)
{
  cp_storage_class storage_class;
  if (parser->in_unbraced_linkage_specification_p)
    {
      error ("invalid use of %qD in linkage specification",
	     ridpointers[keyword]);
      return;
    }
  else if (decl_specs->storage_class != sc_none)
    {
      decl_specs->conflicting_specifiers_p = true;
      return;
    }
  if ((keyword == RID_EXTERN || keyword == RID_STATIC)
      && decl_specs->specs[(int) ds_thread])
    {
      error ("%<__thread%> before %qD", ridpointers[keyword]);
      decl_specs->specs[(int) ds_thread] = 0;
    }
  switch (keyword)
    {
    case RID_AUTO:
      storage_class = sc_auto;
      break;
    case RID_REGISTER:
      storage_class = sc_register;
      break;
    case RID_STATIC:
      storage_class = sc_static;
      break;
    case RID_EXTERN:
      storage_class = sc_extern;
      break;
    case RID_MUTABLE:
      storage_class = sc_mutable;
      break;
    default:
      gcc_unreachable ();
    }
  decl_specs->storage_class = storage_class;
  if (decl_specs->specs[(int)ds_typedef])
    decl_specs->conflicting_specifiers_p = true;
}
static void cp_parser_set_storage_class ( cp_parser * parser , cp_decl_specifier_seq * decl_specs , enum rid keyword ) { cp_storage_class storage_class ; if ( parser -> in_unbraced_linkage_specification_p ) { error ( " " , ridpointers [ keyword ] ) ; return ; } else if ( decl_specs -> storage_class != sc_none ) { decl_specs -> conflicting_specifiers_p = true ; return ; } if ( ( keyword == RID_EXTERN || keyword == RID_STATIC ) && decl_specs -> specs [ ( int ) ds_thread ] ) { error ( " " , ridpointers [ keyword ] ) ; decl_specs -> specs [ ( int ) ds_thread ] = 0 ; } switch ( keyword ) { case RID_AUTO : storage_class = sc_auto ; break ; case RID_REGISTER : storage_class = sc_register ; break ; case RID_STATIC : storage_class = sc_static ; break ; case RID_EXTERN : storage_class = sc_extern ; break ; case RID_MUTABLE : storage_class = sc_mutable ; break ; default : gcc_unreachable ( ) ; } decl_specs -> storage_class = storage_class ; if ( decl_specs -> specs [ ( int ) ds_typedef ] ) decl_specs -> conflicting_specifiers_p = true ; }
Update the DECL_SPECS to reflect the storage class indicated by
KEYWORD.
Update the DECL_SPECS to reflect the storage class indicated by KEYWORD .
/* A storage class specifier cannot be applied alongside a typedef 
     specifier. If there is a typedef specifier present then set 
     conflicting_specifiers_p which will trigger an error later
     on in grokdeclarator. */