Bug 8696 – Compiler reports incorrect dangling else with version attributes

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-19T12:16:00Z
Last change time
2012-09-19T21:03:29Z
Assigned to
nobody
Creator
alex

Comments

Comment #0 by alex — 2012-09-19T12:16:22Z
$ cat test.d version (Posix): version (linux) { } else version (OSX) { } else { } $ <> dmd -w -lib test.d test.d(9): Warning: else is dangling, add { } after condition at test.d(1) test.d(6): Warning: else is dangling, add { } after condition at test.d(1) I don't see any reason at all that this should be considered a dangling else case.
Comment #1 by ibuclaw — 2012-09-19T13:46:52Z
Comment #2 by github-bugzilla — 2012-09-19T17:54:49Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/dc2aa0680f8d044a2e86032523d923f3631972df Issue 8696 - Compiler reports incorrect dangling else with version attributes https://github.com/D-Programming-Language/dmd/commit/ad9136cb89ab5cfdadd445e4ba86d6447dfd549d Add unittest for issue 8696. https://github.com/D-Programming-Language/dmd/commit/7eb566a1a81b458426dbadb3c069bcc6e5d0f584 Merge pull request #1129 from ibuclaw/danglingelse Issue 8696 - Compiler reports incorrect dangling else with version():
Comment #3 by kekeniro2 — 2012-09-19T21:03:29Z
*** Issue 7601 has been marked as a duplicate of this issue. ***