... the patch.

Paolo.

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

        * parser.c (cp_parser_unary_expression): Add default arguments.
        (cp_parser_cast_expression, cp_parser_sizeof_operand,
        cp_parser_omp_atomic): Adjust.
Index: parser.c
===================================================================
--- parser.c    (revision 216502)
+++ parser.c    (working copy)
@@ -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* parse
    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 @@ static tree
                                       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
 
   /* 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
   /* 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
     {
     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
       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
        }
       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
     }
 
 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;
     }

Reply via email to