Semicolons at the end of member function definitions
Mark Mitchell
mark@codesourcery.com
Thu Aug 2 02:28:00 GMT 2007
Volker Reichelt wrote:
> 2007-03-26 Dirk Mueller <dmueller@suse.de>
>
> * parser.c (cp_parser_member_declaration): Pedwarn
> about stray semicolons after member declarations.
>
> It makes
>
> struct A
> {
> void foo() {};
> }
That is indeed still legal in the current working draft. (The reason
that I copied the grammar productions above the parser functions was so
that it would be easy to check things like this...)
> Therefore, IMHO the patch is wrong and should be reverted.
Yes, please go ahead and revert it. And, if you have time, please add a
test-case specifically for this case. The previous patch removed
semicolons from lots of valid code, but probably none of those test
cases were specifically for this case.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc
mailing list