aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/test19185.d
blob: d5a1e5ec7c5ff4a148f7f7978f9866510c312a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// https://issues.dlang.org/show_bug.cgi?id=19185

int fun()
{
    int x = 2;
    struct A
    {
        int a;
        this(int a)
        {
            this.a = a + x;      // segault here
        }
    }

    A a = 5;
    return a.a;
}

void main()
{
    assert(fun() == 7);
}