www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7469] New: template mangling depends on instantiation order

reply d-bugmail puremagic.com writes:
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



---- 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: -------
Feb 08 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7469




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: -------
Feb 09 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7469




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: -------
Mar 09 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Oct 13 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7469




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: -------
Oct 13 2013