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

Thomas Kuehne thomas-dloop at kuehne.cn
Sat Apr 1 12:28:11 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-03-26:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=75
> 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.

Added to DStress as
http://dstress.kuehne.cn/complex/unittest_09
http://dstress.kuehne.cn/run/u/unittest_09_E.d
http://dstress.kuehne.cn/run/u/unittest_09_F.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFELlUO3w+/yD4P9tIRAgtdAJ9B6p+vqOpAruOY+GngKH5X3NYpdgCcDc8A
QtELcx7NrV/w9zjJOhF6AMc=
=eG6G
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list