Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail289.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail289.d(12): Error: cannot cast from function pointer to delegate
5 ---
6 */
7
8 alias void delegate() Dg;
9 void fun() {}
10 void gun()
11 {
12 Dg d = cast(void delegate())&fun;
13 }