This is the mail archive of the gcc-patches@gcc.gnu.org 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] Only allow __label__ at the beginning of compound statements as documented (PR c++/32121)


Jakub Jelinek wrote:

> So do I need to write:
> 
> /* Parse a compound-statement.
> 
>    compound-statement:
>      { statement-seq [opt] }
> 
>    GNU extension:
> 
>    compound-statement:
>      { label-declaration-seq [opt] statement-seq [opt] }
> 
>    label-declaration-seq:
>      label-declaration
>      label-declaration-seq label-declaration
> 
>    Returns a tree representing the statement.  */

Yes.

And the patch is OK with that change.  I'm sympathetic to Tom's idea
that the beginning-of-block restriction is artificial, and I'm concerned
about backwards-compatibility -- but as this feature exists primarily
for compatibility with GNU C and as I'm not at all confident we handle
the difficult middle-of-block cases correctly, I think this is OK.

However, if reports come in of this causing problems, we will need to
reconsider.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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