www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19491] New: ICE (segfault) when initializing scope variable


          Issue ID: 19491
           Summary: ICE (segfault) when initializing scope variable with
                    shared type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: rightfold+bugzilla+dlang gmail.com

Tested with DMD 2.081.2. This bug does not seem to occur on DMD 2.073.

The following example causes DMD to ICE with a segfault:

$ cat example.d
class Foo {
    shared this() { }

void main() {
    scope foo = new shared Foo();
$ dmd example.d
Segmentation fault

If you replace scope by auto then it will compile just fine.

Dec 15 2018