www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17883] New: Error: undefined identifier: Static if bodies

https://issues.dlang.org/show_bug.cgi?id=17883

          Issue ID: 17883
           Summary: Error: undefined identifier: Static if bodies depend
                    on order of declarations
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

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.

--
Oct 07