Thread overview
[Issue 7469] New: template mangling depends on instantiation order
Feb 09, 2012
dawg@dawgfoto.de
Feb 09, 2012
dawg@dawgfoto.de
Mar 10, 2012
dawg@dawgfoto.de
Oct 13, 2013
Martin Nowak
Oct 13, 2013
Martin Nowak
February 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7469

           Summary: template mangling depends on instantiation order
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: dawg@dawgfoto.de


--- Comment #0 from dawg@dawgfoto.de 2012-02-08 20:26:03 PST ---
---- bug.d ----
struct Foo(int i)
{
}

version (A)
{
    Foo!3  fooa;
    Foo!3u foob;
}
else
{
    Foo!3u fooa;
    Foo!3  foob;
}

pragma(msg, typeof(fooa).mangleof);
pragma(msg, typeof(foob).mangleof);
----
dmd -c bug.d

S3bug11__T3FooVk3Z3Foo
S3bug11__T3FooVk3Z3Foo
----
dmd -c -version=A bug.d

S3bug11__T3FooVi3Z3Foo
S3bug11__T3FooVi3Z3Foo

----

The mangling should depend on the template value parameter type not the type of the argument.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7469



--- Comment #1 from dawg@dawgfoto.de 2012-02-09 04:36:14 PST ---
cat > bug.d << EOF
struct S128(T, int k=1)
{
}

version (A)
{
    alias S128!(int) fooa;
    alias S128!(int, 1) foob;
}
else
{
    alias S128!(int, 1) fooa;
    alias S128!(int) foob;
}

pragma(msg, fooa.mangleof);
pragma(msg, foob.mangleof);
EOF

dmd -c bug.d
dmd -c -version=A bug.d
----
S3bug14__T4S128TiVi1Z4S128
S3bug14__T4S128TiVi1Z4S128
----
S3bug11__T4S128TiZ4S128
S3bug11__T4S128TiZ4S128
----
Similar bug with default values.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 10, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7469



--- Comment #2 from dawg@dawgfoto.de 2012-03-09 19:05:41 PST ---
https://github.com/D-Programming-Language/dmd/pull/701

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7469


Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3
         AssignedTo|nobody@puremagic.com        |code@dawg.eu


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7469



--- Comment #3 from Martin Nowak <code@dawg.eu> 2013-10-13 16:34:55 PDT ---
Fixing this issue would allow us to use the mangling as hash key for looking up existing template instantiations. Currently the template arguments are used for comparison and to compute the hash (TemplateDeclaration::findExistingInstance).

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