<div dir="ltr">It should be possible to handle this case without tentative parsing or lookahead. Consume the attributes onto a new list; if the next token is a semicolon, then push them into the label's attribute list; otherwise, ParseStatementOrDeclarationAfterAttributes.<div>
<br></div><div>What does GCC do if there are #pragmas between the case label and the attribute, and/or between the attribute and the semicolon?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 7:23 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ping<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Sep 23, 2013 at 7:02 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br>
> In C++ mode, attributes following labels can be ambiguous as they<br>
> could apply either to the label, or to a declaration following the<br>
> label.  According to<br>
> <a href="http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html" target="_blank">http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html</a>, a GNU<br>
> attribute following a label in C++ mode is only legal if the token<br>
> after the attribute is a semicolon.  This patch addresses PR8455.<br>
><br>
> ~Aaron<br>
</div></div></blockquote></div><br></div>