Semicolons at the end of member function definitions

Volker Reichelt
Mon Jul 30 23:36:00 GMT 2007


I just stumbled over the patch

2007-03-26  Dirk Mueller  <>

       * parser.c (cp_parser_member_declaration): Pedwarn
       about stray semicolons after member declarations.

which was approved by Gaby here:
and made it into the trunk here:

It makes

  struct A
     void foo() {};

a hard error with -pedantic.

The 1998 version of the standard (sorry, I don't have the 2003 version
available) contains in [class.mem]:

    function-definition ;opt

Therefore, IMHO the patch is wrong and should be reverted.
Or am I missing something?


More information about the Gcc mailing list