www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22489] New: C header generation ignores custom mangling


          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 puremagic.com
          Reporter: alphaglosined gmail.com

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

Nov 07 2021