c-parser.c (c_parser_postfix_expression): Remove unused code.
authorMarek Polacek <polacek@redhat.com>
Fri, 18 Aug 2017 12:26:00 +0000 (12:26 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 18 Aug 2017 12:26:00 +0000 (12:26 +0000)
* c-parser.c (c_parser_postfix_expression): Remove unused code.  Update
commentary.

From-SVN: r251181

gcc/c/ChangeLog
gcc/c/c-parser.c

index da12c3aefe1a4abb8cf762b4fdb4d87b32a3cc9d..9dcd1c324806daf73e87b5d149cb188dfe7f1c76 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-18  Marek Polacek  <polacek@redhat.com>
+
+       * c-parser.c (c_parser_postfix_expression): Remove unused code.  Update
+       commentary.
+
 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR c/53037
index 1402ba67204601576b630ce149ff71be4cd0fddf..5c965d4420d3f4065ee0b1a76f6907e04c2c4f60 100644 (file)
@@ -7752,7 +7752,8 @@ c_parser_generic_selection (c_parser *parser)
 }
 
 /* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2,
-   C11 6.5.1-6.5.2).
+   C11 6.5.1-6.5.2).  Compound literals aren't handled here; callers have to
+   call c_parser_postfix_expression_after_paren_type on encountering them.
 
    postfix-expression:
      primary-expression
@@ -7792,7 +7793,7 @@ c_parser_generic_selection (c_parser *parser)
      __builtin_types_compatible_p ( type-name , type-name )
      __builtin_complex ( assignment-expression , assignment-expression )
      __builtin_shuffle ( assignment-expression , assignment-expression )
-     __builtin_shuffle ( assignment-expression , 
+     __builtin_shuffle ( assignment-expression ,
                         assignment-expression ,
                         assignment-expression, )
 
@@ -7943,28 +7944,6 @@ c_parser_postfix_expression (c_parser *parser)
          set_c_expr_source_range (&expr, loc, close_loc);
          mark_exp_read (expr.value);
        }
-      else if (c_token_starts_typename (c_parser_peek_2nd_token (parser)))
-       {
-         /* A compound literal.  ??? Can we actually get here rather
-            than going directly to
-            c_parser_postfix_expression_after_paren_type from
-            elsewhere?  */
-         location_t loc;
-         struct c_type_name *type_name;
-         c_parser_consume_token (parser);
-         loc = c_parser_peek_token (parser)->location;
-         type_name = c_parser_type_name (parser);
-         c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
-                                    "expected %<)%>");
-         if (type_name == NULL)
-           {
-             expr.set_error ();
-           }
-         else
-           expr = c_parser_postfix_expression_after_paren_type (parser,
-                                                                type_name,
-                                                                loc);
-       }
       else
        {
          /* A parenthesized expression.  */