[Issue 22021] New: pragma(mangle) not accepted in function body

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 13 10:29:06 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22021

          Issue ID: 22021
           Summary: pragma(mangle) not accepted in function body
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

void main() {
    pragma(mangle, "bar")
    extern(C) static void foo() {
    }
}

onlineapp.d(4): Error: unrecognized `pragma(mangle)`

To workaround, use a dummy struct:

void main() {
    static struct S {
       pragma(mangle, "bar")
       extern(C) static void foo() {
       }
    }
}

--


More information about the Digitalmars-d-bugs mailing list