Commit 3ec0922b by Paolo Carlini Committed by Paolo Carlini

parser.c (cp_parser_unary_expression): Add default arguments.

2014-10-21  Paolo Carlini  <paolo.carlini@oracle.com>

	* parser.c (cp_parser_unary_expression): Add default arguments.
	(cp_parser_cast_expression, cp_parser_sizeof_operand,
	cp_parser_omp_atomic): Adjust.

From-SVN: r216516
parent 6b17203a
2014-10-21 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_unary_expression): Add default arguments.
(cp_parser_cast_expression, cp_parser_sizeof_operand,
cp_parser_omp_atomic): Adjust.
2014-10-20 Jason Merrill <jason@redhat.com> 2014-10-20 Jason Merrill <jason@redhat.com>
PR c++/63601 PR c++/63601
......
...@@ -1968,7 +1968,7 @@ enum { non_attr = 0, normal_attr = 1, id_attr = 2 }; ...@@ -1968,7 +1968,7 @@ enum { non_attr = 0, normal_attr = 1, id_attr = 2 };
static void cp_parser_pseudo_destructor_name static void cp_parser_pseudo_destructor_name
(cp_parser *, tree, tree *, tree *); (cp_parser *, tree, tree *, tree *);
static tree cp_parser_unary_expression static tree cp_parser_unary_expression
(cp_parser *, bool, bool, cp_id_kind *); (cp_parser *, cp_id_kind * = NULL, bool = false, bool = false, bool = false);
static enum tree_code cp_parser_unary_operator static enum tree_code cp_parser_unary_operator
(cp_token *); (cp_token *);
static tree cp_parser_new_expression static tree cp_parser_new_expression
...@@ -7104,8 +7104,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser, ...@@ -7104,8 +7104,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser,
Returns a representation of the expression. */ Returns a representation of the expression. */
static tree static tree
cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, cp_parser_unary_expression (cp_parser *parser, cp_id_kind * pidk,
bool decltype_p, cp_id_kind * pidk) bool address_p, bool cast_p, bool decltype_p)
{ {
cp_token *token; cp_token *token;
enum tree_code unary_operator; enum tree_code unary_operator;
...@@ -7381,14 +7381,6 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, ...@@ -7381,14 +7381,6 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
pidk); pidk);
} }
static inline tree
cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p,
cp_id_kind * pidk)
{
return cp_parser_unary_expression (parser, address_p, cast_p,
/*decltype*/false, pidk);
}
/* Returns ERROR_MARK if TOKEN is not a unary-operator. If TOKEN is a /* Returns ERROR_MARK if TOKEN is not a unary-operator. If TOKEN is a
unary-operator, the corresponding tree code is returned. */ unary-operator, the corresponding tree code is returned. */
...@@ -8018,8 +8010,8 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p, ...@@ -8018,8 +8010,8 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p,
/* If we get here, then it's not a cast, so it must be a /* If we get here, then it's not a cast, so it must be a
unary-expression. */ unary-expression. */
return cp_parser_unary_expression (parser, address_p, cast_p, return cp_parser_unary_expression (parser, pidk, address_p,
decltype_p, pidk); cast_p, decltype_p);
} }
/* Parse a binary expression of the general form: /* Parse a binary expression of the general form:
...@@ -24374,8 +24366,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword) ...@@ -24374,8 +24366,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
/* If the type-id production did not work out, then we must be /* If the type-id production did not work out, then we must be
looking at the unary-expression production. */ looking at the unary-expression production. */
if (!expr) if (!expr)
expr = cp_parser_unary_expression (parser, /*address_p=*/false, expr = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
/* Go back to evaluating expressions. */ /* Go back to evaluating expressions. */
--cp_unevaluated_operand; --cp_unevaluated_operand;
...@@ -29039,8 +29030,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) ...@@ -29039,8 +29030,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok)
{ {
case OMP_ATOMIC_READ: case OMP_ATOMIC_READ:
case NOP_EXPR: /* atomic write */ case NOP_EXPR: /* atomic write */
v = cp_parser_unary_expression (parser, /*address_p=*/false, v = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
if (v == error_mark_node) if (v == error_mark_node)
goto saw_error; goto saw_error;
if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) if (!cp_parser_require (parser, CPP_EQ, RT_EQ))
...@@ -29048,8 +29038,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) ...@@ -29048,8 +29038,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok)
if (code == NOP_EXPR) if (code == NOP_EXPR)
lhs = cp_parser_expression (parser); lhs = cp_parser_expression (parser);
else else
lhs = cp_parser_unary_expression (parser, /*address_p=*/false, lhs = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
if (lhs == error_mark_node) if (lhs == error_mark_node)
goto saw_error; goto saw_error;
if (code == NOP_EXPR) if (code == NOP_EXPR)
...@@ -29070,8 +29059,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) ...@@ -29070,8 +29059,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok)
} }
else else
{ {
v = cp_parser_unary_expression (parser, /*address_p=*/false, v = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
if (v == error_mark_node) if (v == error_mark_node)
goto saw_error; goto saw_error;
if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) if (!cp_parser_require (parser, CPP_EQ, RT_EQ))
...@@ -29082,8 +29070,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) ...@@ -29082,8 +29070,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok)
} }
restart: restart:
lhs = cp_parser_unary_expression (parser, /*address_p=*/false, lhs = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
orig_lhs = lhs; orig_lhs = lhs;
switch (TREE_CODE (lhs)) switch (TREE_CODE (lhs))
{ {
...@@ -29322,14 +29309,12 @@ stmt_done: ...@@ -29322,14 +29309,12 @@ stmt_done:
{ {
if (!cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON)) if (!cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON))
goto saw_error; goto saw_error;
v = cp_parser_unary_expression (parser, /*address_p=*/false, v = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
if (v == error_mark_node) if (v == error_mark_node)
goto saw_error; goto saw_error;
if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) if (!cp_parser_require (parser, CPP_EQ, RT_EQ))
goto saw_error; goto saw_error;
lhs1 = cp_parser_unary_expression (parser, /*address_p=*/false, lhs1 = cp_parser_unary_expression (parser);
/*cast_p=*/false, NULL);
if (lhs1 == error_mark_node) if (lhs1 == error_mark_node)
goto saw_error; goto saw_error;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment