www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 619] New: Alias of templated struct instance crashes 0.175

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

           Summary: Alias of templated struct instance crashes 0.175
           Product: D
           Version: 0.175
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: kirklin.mcdonald gmail.com


The following code crashes DMD 0.175, but works in DMD 0.174:

import std.stdio;

struct Foo {
    int i;
}

template some_struct_instance(T) {
    static Foo some_struct_instance = {
        5, /*i*/
    };
}

void main() {
    alias some_struct_instance!(int) inst;
    writefln(inst.i);
}

Curiously, it works if main is rewritten like this:

void main() {
    writefln(some_struct_instance!(int).i);
}


-- 
Nov 29 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=619


deewiant gmail.com changed:

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




------- Comment #1 from deewiant gmail.com  2006-12-03 04:11 -------
Fixed in DMD 0.176.


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





------- Comment #2 from thomas-dloop kuehne.cn  2006-12-30 20:09 -------
Added to DStress as
http://dstress.kuehne.cn/run/t/template_54_A.d
http://dstress.kuehne.cn/run/t/template_54_B.d


-- 
Dec 30 2006