Bug 8898 – false positive dangling else warning

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-26T11:47:00Z
Last change time
2013-02-17T08:58:11Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-10-26T11:47:58Z
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.
Comment #4 by k.hara.pg — 2013-02-16T23:22:48Z
Comment #5 by github-bugzilla — 2013-02-17T06:42:46Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8cc8a41836ae504e587f6a952b1c1cbb5a2245a3 fix Issue 8898 - false positive dangling else warning https://github.com/D-Programming-Language/dmd/commit/28e6cc14374a10be122346b0f3332cea57076234 Merge pull request #1668 from 9rnsr/fix8898 fix Issue 8898 - false positive dangling else warning