[Issue 22489] New: C header generation ignores custom mangling

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 7 19:46:33 UTC 2021


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

          Issue ID: 22489
           Summary: C header generation ignores custom mangling
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: alphaglosined at gmail.com

```d
import std.traits : Parameters;

class Type {
    this() {}
}
pragma(msg, creator.mangleof); // _D9onlineapp7creatorFZPv
pragma(mangle, "create_" ~ __traits(identifier, Type))
export extern(C) void* creator(Parameters!(Type.__ctor) args) {
    pragma(msg, creator.mangleof); // create_Type
        return cast(void*)(new Type(args));
}
pragma(msg, creator.mangleof); // create_Type
```

The assembly for creator is create_Type but with -HC it is being generated as
creator.

--


More information about the Digitalmars-d-bugs mailing list