Bug 2354 – conditional compilation rejects else if the declaration is a single pragma

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2008-09-11T11:34:00Z
Last change time
2017-07-22T12:36:06Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
snake.scaly

Comments

Comment #0 by snake.scaly — 2008-09-11T11:34:04Z
Compiler refuses to accept the following code: version(Windows) pragma(msg, "true"); else pragma(msg, "false"); The compiler output is: >dmd -c test.d test3.d(3): Declaration expected, not 'else' Also happens with static if instead of version.
Comment #1 by k.hara.pg — 2015-07-16T13:28:58Z
Comment #2 by github-bugzilla — 2015-07-16T23:51:39Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d7ae0de2a63f1dcc283607f233d34f25e23b9851 fix Issue 2354 - conditional compilation rejects else if the declaration is a single pragma Accept the semicolon followed by `Pragma`, although a semicolon followed by `Attribute` is disallowed in `parseBlock()`. https://github.com/D-Programming-Language/dmd/commit/80a326e0fcc8b4ee941521fb44fed93d8d03c7dd Merge pull request #4817 from 9rnsr/fix2354 Issue 2354 - conditional compilation rejects else if the declaration is a single pragma
Comment #3 by github-bugzilla — 2017-07-22T12:36:06Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/d7ae0de2a63f1dcc283607f233d34f25e23b9851 fix Issue 2354 - conditional compilation rejects else if the declaration is a single pragma https://github.com/dlang/dmd/commit/80a326e0fcc8b4ee941521fb44fed93d8d03c7dd Merge pull request #4817 from 9rnsr/fix2354