www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18094] New: Crash on variadic arguments

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

          Issue ID: 18094
           Summary: Crash on variadic arguments
           Product: D
           Version: D2
          Hardware: x86_64
               URL: https://run.dlang.io/is/8LkLsm
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 sneakemail.com

int test1()
{
        static immutable string[] optsldc=["a","a"];
        Put(optsldc);
        return 0;
}
void Put(string item)
{
}
void Put(in string[] items...)
{
        assert(items.length!=0);
        foreach(item;items)Put(item);
}
int main(string[] args)
{
    return test1();
}

This code crashes when run.

--
Dec 17 2017