Thread overview
[Issue 16430] Show a warning when a semicolon is used after a struct or enum definition
Aug 25, 2016
b2.temp@gmx.com
Aug 25, 2016
ag0aep6g@gmail.com
Aug 25, 2016
ag0aep6g@gmail.com
Aug 26, 2016
Cauterite
Aug 26, 2016
b2.temp@gmx.com
Aug 26, 2016
b2.temp@gmx.com
Aug 26, 2016
b2.temp@gmx.com
Mar 21, 2020
Basile-z
Dec 17, 2022
Iain Buclaw
August 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #1 from b2.temp@gmx.com ---
https://issues.dlang.org/show_bug.cgi?id=16378

--
August 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g@gmail.com

--- Comment #2 from ag0aep6g@gmail.com ---
(In reply to greensunny12 from comment #0)
> but I
> guess there are more cases where the DMD frontend accepts a lot more than
> defined by the spec.

The spec recognizes those semicolons. They're empty 'DeclDef's as per <http://dlang.org/spec/module.html#DeclDef> (at the bottom of the list).

I'd suggest warning on every empty DeclDef and not only on those behind structs/enums.

--
August 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to ag0aep6g from comment #2)
> I'd suggest warning on every empty DeclDef and not only on those behind structs/enums.

for(;;)

--
August 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

--- Comment #4 from ag0aep6g@gmail.com ---
(In reply to Steven Schveighoffer from comment #3)
> (In reply to ag0aep6g from comment #2)
> > I'd suggest warning on every empty DeclDef and not only on those behind structs/enums.
> 
> for(;;)

According to <http://dlang.org/spec/statement.html#for-statement>, those semicolons are part of the 'for' syntax. That is, they're not empty 'DeclDef's (and they're not empty statements either). So they shouldn't be affected.

--
August 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

Cauterite <cauterite@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cauterite@gmail.com

--- Comment #5 from Cauterite <cauterite@gmail.com> ---
Since DMD already emits warning for empty statements, I would endorse warnings for empty declarations too, for the sake of consistency.

--
August 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--- Comment #6 from b2.temp@gmx.com ---
libdparse already produces warnings for empty statements. While it does not reflect at 100%  the D front-end, I think new warning could be added, especially since the author is a bit the assignee for all the grammar stuff.

About for(;;), still based on libdparse, ag0aep6g is right, there won't be any warning, that's another thing.

--
August 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

--- Comment #7 from b2.temp@gmx.com ---
*** Issue 16378 has been marked as a duplicate of this issue. ***

--
August 26, 2016
https://issues.dlang.org/show_bug.cgi?id=16430

--- Comment #8 from b2.temp@gmx.com ---
(In reply to b2.temp from comment #6)
> libdparse already produces warnings for empty statements.

Oops, I meant that it does that for empty declarations, already, while DMD not yet !

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=16430

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16430

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--