www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10249] New: incorrect mangling for overloaded symbol

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10249

           Summary: incorrect mangling for overloaded symbol
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid, wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2013-06-02 23:57:16 PDT ---
If a template takes alias parameter, X1 to X3 should be different instances
each other, but does not.

template X(alias f) {}

class C
{
    void foo(int) {}
    void foo(string) {}
}
alias X1 = X!(C.foo);
alias X2 = X!(__traits(getOverloads, C, "foo")[0]);
alias X3 = X!(__traits(getOverloads, C, "foo")[1]);

static assert(!__traits(isSame, X1, X2));   // fails, should pass
static assert(!__traits(isSame, X2, X3));   // pass
static assert(!__traits(isSame, X1, X3));   // pass

// Even more worse, mangled name of each instances is incorrect.
pragma(msg, X1.mangleof);   // 4test27__T1XS18_D4test1C3fooMFiZvZ
pragma(msg, X2.mangleof);   // 4test27__T1XS18_D4test1C3fooMFiZvZ
pragma(msg, X3.mangleof);   // 4test29__T1XS20_D4test1C3fooMFAyaZvZ

Currently X1 and X2 has same mangled name. If template X has actual code, the
instantiated code symbols would conflict at the link stage.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10249


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-06-03 04:30:28 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2125

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 03 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10249



--- Comment #2 from github-bugzilla puremagic.com 2013-06-24 09:08:05 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a15428cd9ddc08400b0a94e84ab4e68548bac67f
fix Issue 10249 - incorrect mangling for overloaded symbol

https://github.com/D-Programming-Language/dmd/commit/7109d7813f32adfa5a307e09af70aa895ceebb82
Merge pull request #2125 from 9rnsr/fix10249

Issue 10249 - incorrect mangling for overloaded symbol

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 24 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10249


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 24 2013