From 3ec0922b864c63bcd9e5ca4522b6c3bfc64881d9 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 21 Oct 2014 14:14:06 +0000 Subject: [PATCH] parser.c (cp_parser_unary_expression): Add default arguments. 2014-10-21 Paolo Carlini * 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 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 39 ++++++++++++--------------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e61ae2bfa83..e5667506b6a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-10-21 Paolo Carlini + + * 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 PR c++/63601 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c73099547ff..62a815eb42c 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1968,7 +1968,7 @@ enum { non_attr = 0, normal_attr = 1, id_attr = 2 }; static void cp_parser_pseudo_destructor_name (cp_parser *, tree, tree *, tree *); 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 (cp_token *); static tree cp_parser_new_expression @@ -7104,8 +7104,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser, Returns a representation of the expression. */ static tree -cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, - bool decltype_p, cp_id_kind * pidk) +cp_parser_unary_expression (cp_parser *parser, cp_id_kind * pidk, + bool address_p, bool cast_p, bool decltype_p) { cp_token *token; enum tree_code unary_operator; @@ -7381,14 +7381,6 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, 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 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, /* If we get here, then it's not a cast, so it must be a unary-expression. */ - return cp_parser_unary_expression (parser, address_p, cast_p, - decltype_p, pidk); + return cp_parser_unary_expression (parser, pidk, address_p, + cast_p, decltype_p); } /* Parse a binary expression of the general form: @@ -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 looking at the unary-expression production. */ if (!expr) - expr = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + expr = cp_parser_unary_expression (parser); /* Go back to evaluating expressions. */ --cp_unevaluated_operand; @@ -29039,8 +29030,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) { case OMP_ATOMIC_READ: case NOP_EXPR: /* atomic write */ - v = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + v = cp_parser_unary_expression (parser); if (v == error_mark_node) goto saw_error; if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) @@ -29048,8 +29038,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) if (code == NOP_EXPR) lhs = cp_parser_expression (parser); else - lhs = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + lhs = cp_parser_unary_expression (parser); if (lhs == error_mark_node) goto saw_error; if (code == NOP_EXPR) @@ -29070,8 +29059,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) } else { - v = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + v = cp_parser_unary_expression (parser); if (v == error_mark_node) goto saw_error; if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) @@ -29082,8 +29070,7 @@ cp_parser_omp_atomic (cp_parser *parser, cp_token *pragma_tok) } restart: - lhs = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + lhs = cp_parser_unary_expression (parser); orig_lhs = lhs; switch (TREE_CODE (lhs)) { @@ -29322,14 +29309,12 @@ stmt_done: { if (!cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON)) goto saw_error; - v = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + v = cp_parser_unary_expression (parser); if (v == error_mark_node) goto saw_error; if (!cp_parser_require (parser, CPP_EQ, RT_EQ)) goto saw_error; - lhs1 = cp_parser_unary_expression (parser, /*address_p=*/false, - /*cast_p=*/false, NULL); + lhs1 = cp_parser_unary_expression (parser); if (lhs1 == error_mark_node) goto saw_error; } -- 2.30.2