This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] empty-declarations
- From: Jason Merrill <jason at redhat dot com>
- To: Nathan Sidwell <nathan at acm dot org>, Volker Reichelt <v dot reichelt at netcologne dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Tue, 10 Apr 2018 12:00:27 -0400
- Subject: Re: [C++ PATCH] empty-declarations
- References: <2d7e797e-7fb8-5ec0-b3b4-026d306817f8@acm.org>
On Tue, Apr 10, 2018 at 11:06 AM, Nathan Sidwell <nathan@acm.org> wrote:
> Jason,
> thanks for looking up about empty-decls. This patch implements the C++11
> change.
>
> At namespace-scope & class-scope we're now silent about empty declarations,
> when not in C++-98 mode.
>
> The class-scope change was a little more invasive, because we silently
> accepted a semicolon after an in-class function definition:
>
> class X {
> void foo () {}; // semi-colon accepted
> };
>
> And we emitted a fixit for that case.
This is the -Wextra-semi warning that Volker added recently, and your
patch would break.
Do we want -Wextra-semi to now warn about all empty declarations at
class/namespace scope, not just after a function definition?
> This isn't a regression. I don't think anyone's complained. Jason, WDYT
> about committing this now?
I'd hold it for stage 1.
Jason