Thread overview
[Issue 13363] DMD accepts bodyless if statement
Aug 23, 2014
yebblies
Aug 23, 2014
Orvid King
Sep 08, 2021
Dennis
August 23, 2014
https://issues.dlang.org/show_bug.cgi?id=13363

yebblies <yebblies@gmail.com> changed:

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

--- Comment #1 from yebblies <yebblies@gmail.com> ---
That should be the same as this:

if ((tok))
AfterProc:
    {}

It's not particularly useful, but what's wrong with it?

--
August 23, 2014
https://issues.dlang.org/show_bug.cgi?id=13363

--- Comment #2 from Orvid King <blah38621@gmail.com> ---
It's the same as that, yes, but there is no actual statement, nor are there any curly brackets to denote an empty statement was intended. I believe that if the behaviour was actually intended, the curly brackets should be required, and that this form should produce an error.

--
September 08, 2021
https://issues.dlang.org/show_bug.cgi?id=13363

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel@live.nl
         Resolution|---                         |INVALID

--- Comment #3 from Dennis <dkorpel@live.nl> ---
(In reply to Orvid King from comment #2)
> but there is no actual statement

There is, it's called a `LabeledStatement` in the grammar.

--