[Bug 75] New: Template aliases in unittests (incorrect code generation)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 26 05:13:22 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=75

           Summary: Template aliases in unittests (incorrect code
                    generation)
           Product: D
           Version: 0.148
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: nail-mail at mail.ru


I have 2 modules:

=== mod.d ===


module mod;

struct Dummy
{
}

struct TemplatedStruct(Param)
{
        static real f = 0;
}

unittest
{
        alias TemplatedStruct!(Dummy) X;        
}

=== test.d === 

import mod;

int main(char[][] args)
{
        TemplatedStruct!(Dummy) e;

        return 0;
}


I compile them with -g -unittest -debug one by one into 2 .obj files, then I
link them together. All compiles and links fine, but on attempt to run
application I've got 'D:\devel\dtest\test.exe is not valid Win32 application'
msg box and 'Access is denied.' in command window.

If I'll comment out alias in unittest, or move it outside unittest, or merge
modules into one, or remove `static real f` in TemplatedStruct -- eror would go
away.


-- 




More information about the Digitalmars-d-bugs mailing list