This is the mail archive of the gcc@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]

Semicolons at the end of member function definitions


Hi,

I just stumbled over the patch

2007-03-26  Dirk Mueller  <dmueller@suse.de>

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

which was approved by Gaby here:
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01456.html
and made it into the trunk here:
http://gcc.gnu.org/ml/gcc-cvs/2007-03/msg00841.html

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]:

  member-declaration:
    ...
    function-definition ;opt
    ...

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

Regards,
Volker


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