Bug 19185 – [ICE] Nested struct segfaults when using variable from outer scope
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-08-22T14:06:26Z
Last change time
2018-09-06T15:43:34Z
Keywords
ice, pull
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2018-08-22T14:06:26Z
void fun()
{
int x = 2;
struct A
{
int a;
this(int a)
{
this.a = a + x; // segault here
}
}
A a = 5;
// A a = A(5); initializing `a` like this works as expected
}
void main()
{
fun();
}
Comment #1 by razvan.nitu1305 — 2018-08-22T14:33:23Z