FreeBSD/contrib/gcc/cp/parser.c
/* A subroutine of cp_parser_postfix_expression that also gets hijacked
   by cp_parser_builtin_offsetof.  We're looking for

     postfix-expression [ expression ]

   FOR_OFFSETOF is set if we're being called in that context, which
   changes how we deal with integer constant expressions.  */
A subroutine of cp_parser_postfix_expression that also gets hijacked
by cp_parser_builtin_offsetof.  We're looking for

postfix-expression [ expression ]

FOR_OFFSETOF is set if we're being called in that context, which
changes how we deal with integer constant expressions.
A subroutine of cp_parser_postfix_expression that also gets hijacked by cp_parser_builtin_offsetof . We ' re looking for postfix - expression [ expression ] FOR_OFFSETOF is set if we ' re being called in that context which changes how we deal with integer constant expressions .
static tree
cp_parser_postfix_open_square_expression (cp_parser *parser,
					  tree postfix_expression,
					  bool for_offsetof)
{
  tree index;
  cp_lexer_consume_token (parser->lexer);
  if (for_offsetof)
    index = cp_parser_constant_expression (parser, false, NULL);
  else
    index = cp_parser_expression (parser, false);
  cp_parser_require (parser, CPP_CLOSE_SQUARE, "`]'");
  postfix_expression = grok_array_decl (postfix_expression, index);
  if (!for_offsetof
      && (cp_parser_non_integral_constant_expression
	  (parser, "an array reference")))
    postfix_expression = error_mark_node;
  return postfix_expression;
}
static tree cp_parser_postfix_open_square_expression ( cp_parser * parser , tree postfix_expression , bool for_offsetof ) { tree index ; cp_lexer_consume_token ( parser -> lexer ) ; if ( for_offsetof ) index = cp_parser_constant_expression ( parser , false , NULL ) ; else index = cp_parser_expression ( parser , false ) ; cp_parser_require ( parser , CPP_CLOSE_SQUARE , " " ) ; postfix_expression = grok_array_decl ( postfix_expression , index ) ; if ( ! for_offsetof && ( cp_parser_non_integral_constant_expression ( parser , " " ) ) ) postfix_expression = error_mark_node ; return postfix_expression ; }
A subroutine of cp_parser_postfix_expression that also gets hijacked
by cp_parser_builtin_offsetof.
A subroutine of cp_parser_postfix_expression that also gets hijacked by cp_parser_builtin_offsetof .
/* Consume the `[' token.  */ /* Parse the index expression.  */ /* ??? For offsetof, there is a question of what to allow here.  If
     offsetof is not being used in an integral constant expression context,
     then we *could* get the right answer by computing the value at runtime.
     If we are in an integral constant expression context, then we might
     could accept any constant expression; hard to say without analysis.
     Rather than open the barn door too wide right away, allow only integer
     constant expressions here.  */ /*cast_p=*/ /* Look for the closing `]'.  */ /* Build the ARRAY_REF.  */ /* When not doing offsetof, array references are not permitted in
     constant-expressions.  */