Bug 19491 – ICE (segfault) when initializing scope variable with shared type
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-12-15T14:39:52Z
Last change time
2018-12-24T19:22:43Z
Assigned to
No Owner
Creator
Chloé
Comments
Comment #0 by rightfold+bugzilla+dlang — 2018-12-15T14:39:52Z
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.
Comment #1 by razvan.nitu1305 — 2018-12-17T10:22:36Z