Issue 17883 - Error: undefined identifier: Static if bodies depend on order of declarations
Summary: Error: undefined identifier: Static if bodies depend on order of declarations
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 critical
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks: 21171
  Show dependency treegraph
 
Reported: 2017-10-07 22:09 UTC by Iain Buclaw
Modified: 2023-04-18 08:55 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2017-10-07 22:09:45 UTC
This does not compile:
---
public import core.sys.posix.sys.mman;
import core.sys.linux.config;

static if (__USE_MISC)
{
    enum MAP_RENAME = MAP_ANONYMOUS;
}

static if (__USE_MISC)
{
    enum MAP_ANONYMOUS = MAP_ANON;
}
---

Swapping the static ifs around, however, and it does.

This is particular bug is causing SPARC, SPARC64, MIPS and MIPS64 builds to fail.
Comment 1 github-bugzilla 2017-10-08 17:51:56 UTC
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/e239f80fbee0c953ed50a039d140d0376647d7d4
Add workaround for issue 17883 in core.sys.linux.sys.mman

https://github.com/dlang/druntime/commit/58d573a593d6417928b9d710421b16802001a2c2
Merge pull request #1931 from ibuclaw/wkarnd17883

Add workaround for issue 17883 in core.sys.linux.sys.mman
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
Comment 2 github-bugzilla 2017-10-16 09:57:23 UTC
Commits pushed to stable at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/e239f80fbee0c953ed50a039d140d0376647d7d4
Add workaround for issue 17883 in core.sys.linux.sys.mman

https://github.com/dlang/druntime/commit/58d573a593d6417928b9d710421b16802001a2c2
Merge pull request #1931 from ibuclaw/wkarnd17883