gcc/testsuite/gdc.test/fail_compilation/test9176.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/test9176.d(14): Error: forward reference to inferred return type of function call `get()` |
| 5 | fail_compilation/test9176.d(10): while evaluating: `static assert(!is(typeof(foo(S()))))` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | void foo(int x) {} |
| 10 | static assert(!is(typeof(foo(S())))); |
| 11 | |
| 12 | struct S |
| 13 | { |
| 14 | auto get() { return get(); } |
| 15 | alias get this; |
| 16 | } |
| 17 | |
| 18 | void main(){} |