llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Parse an initializer-clause.

   initializer-clause:
     assignment-expression
     { initializer-list , [opt] }
     { }

   Returns an expression representing the initializer.

   If the `assignment-expression' production is used the value
   returned is simply a representation for the expression.

   Otherwise, a CONSTRUCTOR is returned.  The CONSTRUCTOR_ELTS will be
   the elements of the initializer-list (or NULL, if the last
   production is used).  The TREE_TYPE for the CONSTRUCTOR will be
   NULL_TREE.  There is no way to detect whether or not the optional
   trailing `,' was provided.  NON_CONSTANT_P is as for
   cp_parser_initializer.  */
Parse an initializer-clause.
initializer-clause:
assignment-expression
{ initializer-list , [opt] }
{ }

Returns an expression representing the initializer.

If the `assignment-expression' production is used the value
returned is simply a representation for the expression.

Otherwise, a CONSTRUCTOR is returned.  The CONSTRUCTOR_ELTS will be
the elements of the initializer-list (or NULL, if the last
production is used).  The TREE_TYPE for the CONSTRUCTOR will be
NULL_TREE.  There is no way to detect whether or not the optional
trailing `,' was provided.
Parse an initializer - clause . initializer - clause : assignment - expression { initializer - list [ opt ] } { } Returns an expression representing the initializer . If the ` assignment - expression ' production is used the value returned is simply a representation for the expression . Otherwise a CONSTRUCTOR is returned . The CONSTRUCTOR_ELTS will be the elements of the initializer - list ( or NULL if the last production is used ) . The TREE_TYPE for the CONSTRUCTOR will be NULL_TREE . There is no way to detect whether or not the optional trailing ` ' was provided .
static tree
cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p)
{
  tree initializer;
  *non_constant_p = false;
  if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
    {
      initializer
	= cp_parser_constant_expression (parser,
					true,
					non_constant_p);
      if (!*non_constant_p)
	initializer = fold_non_dependent_expr (initializer);
    }
  else
    {
      cp_lexer_consume_token (parser->lexer);
      initializer = make_node (CONSTRUCTOR);
      if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_BRACE))
	{
	  CONSTRUCTOR_ELTS (initializer)
	    = cp_parser_initializer_list (parser, non_constant_p);
	  if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
	    cp_lexer_consume_token (parser->lexer);
	}
      cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
    }
  return initializer;
}
static tree cp_parser_initializer_clause ( cp_parser * parser , bool * non_constant_p ) { tree initializer ; * non_constant_p = false ; if ( cp_lexer_next_token_is_not ( parser -> lexer , CPP_OPEN_BRACE ) ) { initializer = cp_parser_constant_expression ( parser , true , non_constant_p ) ; if ( ! * non_constant_p ) initializer = fold_non_dependent_expr ( initializer ) ; } else { cp_lexer_consume_token ( parser -> lexer ) ; initializer = make_node ( CONSTRUCTOR ) ; if ( cp_lexer_next_token_is_not ( parser -> lexer , CPP_CLOSE_BRACE ) ) { CONSTRUCTOR_ELTS ( initializer ) = cp_parser_initializer_list ( parser , non_constant_p ) ; if ( cp_lexer_next_token_is ( parser -> lexer , CPP_COMMA ) ) cp_lexer_consume_token ( parser -> lexer ) ; } cp_parser_require ( parser , CPP_CLOSE_BRACE , " " ) ; } return initializer ; }
Parse an initializer-clause.
Parse an initializer - clause .
/* Assume the expression is constant.  */ /* If it is not a `{', then we are looking at an
     assignment-expression.  */ /*allow_non_constant_p=*/ /* Consume the `{' token.  */ /* Create a CONSTRUCTOR to represent the braced-initializer.  */ /* If it's not a `}', then there is a non-trivial initializer.  */ /* Parse the initializer list.  */ /* A trailing `,' token is allowed.  */ /* Now, there should be a trailing `}'.  */