www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 683] New: dmd segv, this ain't the same as bug 682

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

           Summary: dmd segv, this ain't the same as bug 682
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: davidl 126.com


import std.stdio;
template a(char[]name, T...){
        char[] a(char[]name,T t){
        char[] localchar;
        foreach(a;T)
        {
                writefln(`hello`);
                localchar~=a.mangleof;
        }
        return localchar;
        }
}
void main()
{
        writefln(a!("Adf"[], typeof("adf"),uint).a("Adf"[],"adf",1234));
}
IMHO this should compile & run


-- 
Dec 12 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=683





------- Comment #1 from davidl 126.com  2006-12-13 01:19 -------
umm when i posted this bug, i didn't know the string literal as a temp arg very
well.
the following should compile & run .. and at least the compile error message is
not reasonable
import std.stdio;
template a(char[]name, T...){
        char[] a(T t){ 
        char[] localchar;
        foreach(a;t)
        {
                writefln(`hello`);
                localchar~=typeof(a).mangleof;
        }
        return localchar;
        }
}
void main()
{
        writefln(a!("Adf", typeof("adf"),uint).a("adf",1234));
}


-- 
Dec 12 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=683





------- Comment #2 from bugzilla digitalmars.com  2006-12-13 13:48 -------
I'll fix it, but the ).a( should be replaced with )(, as it is a template
function.


-- 
Dec 13 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=683


bugzilla digitalmars.com changed:

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




------- Comment #3 from bugzilla digitalmars.com  2006-12-27 02:03 -------
Fixed DMD 0.178


-- 
Dec 27 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=683


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #4 from thomas-dloop kuehne.cn  2007-02-27 10:47 -------
Added to DStress as
http://dstress.kuehne.cn/run/b/bug_expression_775_A.d


-- 
Feb 27 2007