cat > bug.d << CODE
static if (true):
version (Foo)
{
}
else
{
}
CODE
> dmd -w -c bug
bug.d(6): Warning: else is dangling, add { } after condition at bug.d(1)
----
Seems like the else is associated with the static if by the dangling counter.
Comment #1 by alex — 2012-10-26T11:50:14Z
This is possibly related to issue #8696.
Comment #2 by alex — 2012-11-04T17:42:39Z
This is not an accepts-invalid; it's a rejects-valid.
Comment #3 by code — 2013-02-13T22:20:01Z
> This is possibly related to issue #8696.
No it still happens.