This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C PATCH to remove unused block of code

On Thu, 17 Aug 2017, Marek Polacek wrote:

> I've been itching to remove this code for some time now.  The comment suggests
> that the code is actually unused, so I replaced the body of that "else if" with
> gcc_unreachable (); and ran regtest/bootstrap and nothing broke, so I propose
> to do away with it.
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

OK, with an appropriate change to the comment above the 
c_parser_postfix_expression function to say that compound literals are not 
handled here and callers have to call 
c_parser_postfix_expression_after_paren_type on encountering them.  (I've 
reviewed all paths to c_parser_postfix_expression in the current parser 
and don't think any of them can send compound literals to it, because 
either they are parsing a specific more restricted syntax incompatible 
with compond literals (OMP cases), are parsing an expression that might be 
a cast expression so need to parse the (type) first to distinguish, or are 
parsing a context such as sizeof where a parenthesized type name is 
allowed as well as a postfix expression and again need to parse the (type) 
first to distinguish.)

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]