June 01, 2023 [Issue 23952] New: Cannot declare pointer to function with linkage | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23952 Issue ID: 23952 Summary: Cannot declare pointer to function with linkage Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: qs.il.paperinik@gmail.com Similar to issue 2753 (Cannot declare pointer to function returning ref), the type syntax cannot express explicit linkage of a function pointer: ```d alias CFunc = extern(C) int function(int); void f(CFunc fp) { } // okay pragma(msg, CFunc); void g(extern(C) int function(int) fp) { } // does not parse ``` The same is true for delegates: ```d struct S { int x; extern(C) int f() => x; } pragma(msg, typeof(&S().f)); // extern (C) int delegate() //void h(extern (C) int delegate() dg) { } // does not parse ``` -- |
Copyright © 1999-2021 by the D Language Foundation