[Issue 1375] New: CTFE fails for null arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 25 09:39:46 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1375

           Summary: CTFE fails for null arrays
           Product: D
           Version: 1.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: samukha at voliacable.com


Neither of the if's compile:

int foo()
{
    char[] s;

    if (s)
    {
    }

    if (s == null)
    {
    }

    if (s is null)
    {
    }

    if (s == "")
    {
    }

    if (s.length)
    {
    }

    return 0;
}

void main()
{
        static x = foo();
}

If s is initialized to a literal, only the last two if's compile successfully.


-- 



More information about the Digitalmars-d-bugs mailing list