[Issue 20974] New: extern(C++, "foo", "bar") template mangling ignores "foo".

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 24 21:22:13 UTC 2020


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

          Issue ID: 20974
           Summary: extern(C++, "foo", "bar") template mangling ignores
                    "foo".
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: rmanth at gmail.com

alias B = A!();

extern(C++, "foo", "bar")
struct A()
{
    double f();
}

pragma(msg, A!().f.mangleof);


On linux it should print _ZN3foo3bar1A1fEv but prints _ZN3bar1A1fEv
On windows it should print ?f@?$A@@bar at foo@@QEAANXZ but prints
?f@?$A@@bar@@QEAANXZ

This basically ignores the "foo" part of the namespace. If you change or remove
the "foo" you get the same result.

If you remove the `alias B = A!()` or move that after the declaration of `A` it
gets the correct mangle.

If you change it to `extern(C++, foo.bar)` it gets the correct mangle.

--


More information about the Digitalmars-d-bugs mailing list