www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2260] New: Template uniqueness not valid anymore from 1.031 to 1.033

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

           Summary: Template uniqueness not valid anymore from 1.031 to
                    1.033
           Product: D
           Version: 1.033
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: walter mail.math.uni-magdeburg.de


The following template-chain does not work correctly, when applied multiple
times:

 class inner (alias F) { }
 
 template outer(alias B)
 {
   void function( inner!(B) ) outer;
 }
 
 template rawmanglednameof(alias A)
 {
   const char[] rawmanglednameof = typeof(&outer!(A)).mangleof;
 }
 
 Stdout.formatln ("{}", rawmanglednameof !(func));
 Stdout.formatln ("{}", rawmanglednameof !(args));
 
 // results in 
 
 PPFC4Test35__T5innerS22_D4Test4funcFiJiKiLiYvZ5innerZv
 PPFC4Test35__T5innerS22_D4Test4funcFiJiKiLiYvZ5innerZv
 
 // in dmd-1.033 it correctly was:
 
 PPFC4Test35__T5innerS22_D4Test4funcFiJiKiLiYvZ5innerZv
 PPFC4Test39__T5innerS26_D4Test4mainFAAaZi4argsAAaZ5innerZv

So it seems, the template is not unique anymore! This bug is confirmed by Don Clugston and it is necessary to work for the compile-time demanglers in dsource/ddl/meta and dsource/meta projects. --
Aug 01 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2260


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |regression




-- 
Aug 01 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2260


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
           Keywords|                            |wrong-code




------- Comment #1 from smjg iname.com  2008-11-24 09:04 -------
Eh, what are func and args?  Absent any declarations of these, the code
shouldn't compile.

Please make sure your testcases are complete and self-contained.


-- 
Nov 24 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2260





------- Comment #2 from walter mail.math.uni-magdeburg.de  2008-12-30 04:27
-------
import tango.io.Stdout;

class inner (alias F) { }

template outer(alias B)
{
  void function( inner!(B) ) outer;
}

template rawmanglednameof(alias A)
{
  const char[] rawmanglednameof = typeof(&outer!(A)).mangleof;
}

void func (int i, out int j, ref int k, lazy int m, ...)
{

}

int main (char[][] args)
{
        Stdout.formatln ("{}", rawmanglednameof !(func));
        Stdout.formatln ("{}", rawmanglednameof !(args));       

        return 0;
}

Okay, this one compiles with Tango. For Phobos you can just replace the
Stdout.formatln by its writefln equivalent. The bug is not library dependent.


-- 
Dec 30 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2260


Don <clugdbug yahoo.com.au> changed:

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




--- Comment #3 from Don <clugdbug yahoo.com.au>  2009-08-07 02:46:10 PDT ---
This is working in 2.031 and 1.046. I suspect it was fixed some time ago.

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