FreeBSD/contrib/gcc/cp/parser.c
/* Parse the part of a function-definition that follows the
   declarator.  INLINE_P is TRUE iff this function is an inline
   function defined with a class-specifier.

   Returns the function defined.  */
Parse the part of a function-definition that follows the
declarator.  INLINE_P is TRUE iff this function is an inline
function defined with a class-specifier.

Returns the function defined.
Parse the part of a function - definition that follows the declarator . INLINE_P is TRUE iff this function is an inline function defined with a class - specifier . Returns the function defined .
static tree
cp_parser_function_definition_after_declarator (cp_parser* parser,
						bool inline_p)
{
  tree fn;
  bool ctor_initializer_p = false;
  bool saved_in_unbraced_linkage_specification_p;
  bool saved_in_function_body;
  unsigned saved_num_template_parameter_lists;
  saved_in_function_body = parser->in_function_body;
  parser->in_function_body = true;
  if (cp_lexer_next_token_is_keyword (parser->lexer, RID_RETURN))
    {
      cp_lexer_consume_token (parser->lexer);
      cp_parser_identifier (parser);
      error ("named return values are no longer supported");
      while (true)
	{
	  cp_token *token = cp_lexer_peek_token (parser->lexer);
	  if (token->type == CPP_OPEN_BRACE
	      || token->type == CPP_EOF
	      || token->type == CPP_PRAGMA_EOL)
	    break;
	  cp_lexer_consume_token (parser->lexer);
	}
    }
  saved_in_unbraced_linkage_specification_p
    = parser->in_unbraced_linkage_specification_p;
  parser->in_unbraced_linkage_specification_p = false;
  saved_num_template_parameter_lists
    = parser->num_template_parameter_lists;
  parser->num_template_parameter_lists = 0;
  if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TRY))
    ctor_initializer_p = cp_parser_function_try_block (parser);
  else
    ctor_initializer_p
      = cp_parser_ctor_initializer_opt_and_function_body (parser);
  fn = finish_function ((ctor_initializer_p ? 1 : 0) |
			(inline_p ? 2 : 0));
  expand_or_defer_fn (fn);
  parser->in_unbraced_linkage_specification_p
    = saved_in_unbraced_linkage_specification_p;
  parser->num_template_parameter_lists
    = saved_num_template_parameter_lists;
  parser->in_function_body = saved_in_function_body;
  return fn;
}
static tree cp_parser_function_definition_after_declarator ( cp_parser * parser , bool inline_p ) { tree fn ; bool ctor_initializer_p = false ; bool saved_in_unbraced_linkage_specification_p ; bool saved_in_function_body ; unsigned saved_num_template_parameter_lists ; saved_in_function_body = parser -> in_function_body ; parser -> in_function_body = true ; if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_RETURN ) ) { cp_lexer_consume_token ( parser -> lexer ) ; cp_parser_identifier ( parser ) ; error ( " " ) ; while ( true ) { cp_token * token = cp_lexer_peek_token ( parser -> lexer ) ; if ( token -> type == CPP_OPEN_BRACE || token -> type == CPP_EOF || token -> type == CPP_PRAGMA_EOL ) break ; cp_lexer_consume_token ( parser -> lexer ) ; } } saved_in_unbraced_linkage_specification_p = parser -> in_unbraced_linkage_specification_p ; parser -> in_unbraced_linkage_specification_p = false ; saved_num_template_parameter_lists = parser -> num_template_parameter_lists ; parser -> num_template_parameter_lists = 0 ; if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_TRY ) ) ctor_initializer_p = cp_parser_function_try_block ( parser ) ; else ctor_initializer_p = cp_parser_ctor_initializer_opt_and_function_body ( parser ) ; fn = finish_function ( ( ctor_initializer_p ? 1 : 0 ) | ( inline_p ? 2 : 0 ) ) ; expand_or_defer_fn ( fn ) ; parser -> in_unbraced_linkage_specification_p = saved_in_unbraced_linkage_specification_p ; parser -> num_template_parameter_lists = saved_num_template_parameter_lists ; parser -> in_function_body = saved_in_function_body ; return fn ; }
Parse the part of a function-definition that follows the
declarator.
Parse the part of a function - definition that follows the declarator .
/* If the next token is `return', then the code may be trying to
     make use of the "named return value" extension that G++ used to
     support.  */ /* Consume the `return' keyword.  */ /* Look for the identifier that indicates what value is to be
	 returned.  */ /* Issue an error message.  */ /* Skip tokens until we reach the start of the function body.  */ /* The `extern' in `extern "C" void f () { ... }' does not apply to
     anything declared inside `f'.  */ /* Inside the function, surrounding template-parameter-lists do not
     apply.  */ /* If the next token is `try', then we are looking at a
     function-try-block.  */ /* A function-try-block includes the function-body, so we only do
     this next part if we're not processing a function-try-block.  */ /* Finish the function.  */ /* Generate code for it, if necessary.  */ /* Restore the saved values.  */