Re: [C++ PATCH] empty-declarations

2018-04-10 Thread David Malcolm
On Tue, 2018-04-10 at 13:47 -0400, Nathan Sidwell wrote:
> On 04/10/2018 12:43 PM, Jason Merrill wrote:
> > On Tue, Apr 10, 2018 at 12:32 PM, Nathan Sidwell 
> > wrote:
> > > On 04/10/2018 12:00 PM, Jason Merrill wrote:
> > > I don't see why we should warn at all.
> > 
> > It's not on by default, but some people want to get a warning about
> > redundant semicolons.  Clang also has this flag.
> 
> OK, Then I presume it should warn about all such semicolons.

...and presumably each such warning should have a fix-it hint, removing
the redundant token?

Dave


Re: [C++ PATCH] empty-declarations

2018-04-10 Thread Nathan Sidwell

On 04/10/2018 12:43 PM, Jason Merrill wrote:

On Tue, Apr 10, 2018 at 12:32 PM, Nathan Sidwell  wrote:

On 04/10/2018 12:00 PM, Jason Merrill wrote:



I don't see why we should warn at all.


It's not on by default, but some people want to get a warning about
redundant semicolons.  Clang also has this flag.


OK, Then I presume it should warn about all such semicolons.

nathan

--
Nathan Sidwell


Re: [C++ PATCH] empty-declarations

2018-04-10 Thread Jason Merrill
On Tue, Apr 10, 2018 at 12:32 PM, Nathan Sidwell  wrote:
> On 04/10/2018 12:00 PM, Jason Merrill wrote:
>>
>> On Tue, Apr 10, 2018 at 11:06 AM, Nathan Sidwell  wrote:
>
>
>> 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?
>
> I don't see why we should warn at all.

It's not on by default, but some people want to get a warning about
redundant semicolons.  Clang also has this flag.

Jason


Re: [C++ PATCH] empty-declarations

2018-04-10 Thread Nathan Sidwell

On 04/10/2018 12:00 PM, Jason Merrill wrote:

On Tue, Apr 10, 2018 at 11:06 AM, Nathan Sidwell  wrote:



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?


I don't see why we should warn at all.


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.


works for me.

nathan

--
Nathan Sidwell


Re: [C++ PATCH] empty-declarations

2018-04-10 Thread Jason Merrill
On Tue, Apr 10, 2018 at 11:06 AM, Nathan Sidwell  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