www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20630] New: Illegal instruction: when passing enum:string to

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

          Issue ID: 20630
           Summary: Illegal instruction: when passing enum:string to
                    function taking a dstring
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: puremagic zoadian.de

import std.stdio;

struct VariableDefinition {
        string lex;
}

enum LOCALVARS = [

    ];

void foo(dstring s) {
    writeln(s);
}

void main(string[] args) {  
    foo(LOCALVARS[0].lex);
}



this results in Illegal instruction (core dumped)

with DMD 2.090.1 and DMD Beta 2.091.0-beta.1

interestingly ldc2 1.19.0 reports the correct error

--
Mar 03 2020