gcc/testsuite/gdc.test/fail_compilation/fail11545.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail11545.d(14): Error: accessing non-static variable `x` requires an instance of `C` |
| 5 | fail_compilation/fail11545.d(18): Error: accessing non-static variable `x` requires an instance of `C` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | class C |
| 10 | { |
| 11 | int x = 42; |
| 12 | |
| 13 | int function() f1 = function() { |
| 14 | return x; |
| 15 | }; |
| 16 | |
| 17 | int function() f2 = { |
| 18 | return x; |
| 19 | }; |
| 20 | } |