aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail11545.d
blob: 01d8e93d569588eef8e47ef786ee7f9eea35e79d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
TEST_OUTPUT:
---
fail_compilation/fail11545.d(14): Error: accessing non-static variable `x` requires an instance of `C`
fail_compilation/fail11545.d(18): Error: accessing non-static variable `x` requires an instance of `C`
---
*/

class C
{
    int x = 42;

    int function() f1 = function() {
        return x;
    };

    int function() f2 = {
        return x;
    };
}