October 15, 2004 two compiler crashes | ||||
---|---|---|---|---|
| ||||
These two code fragments crash the compiler: <CODE1 compiler crash> import std.stdio; class Conversion(T,U) { private { typedef char Small; class Big{char[2] dummy;} static Small Test(U u); static Big Test(...); static T MakeT(); } public: enum {exists = (Test(MakeT())).sizeof == (Small).sizeof} } int main ( char [] [] args ) { writefln(Conversion!(double,int).exists); return 1; } </CODE1> <CODE2 compiler crash> import std.stdio; import std.c.stdlib; class Cout { Cout set(int x) { printf("%d",x); return this; } alias set opShl; } int main ( char [] [] args ) { Cout cout = new Cout; cout << 5 << 4; writefln,getch; return 1; } </CODE2> |
October 29, 2004 Re: two compiler crashes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | added to dstress: svn://svn.kuehne.cn/dstress/nocompile/bug_20041016_A.d (code 1) svn://svn.kuehne.cn/dstress/nocompile/bug_20041016_B.d (code 2) Thomas In article <ckpj76$2r3m$1@digitaldaemon.com>, Ivan Senji says... > >These two code fragments crash the compiler: > ><CODE1 compiler crash> >import std.stdio; > >class Conversion(T,U) >{ > private > { > typedef char Small; > class Big{char[2] dummy;} > static Small Test(U u); > static Big Test(...); > static T MakeT(); > } > public: > enum {exists = (Test(MakeT())).sizeof == (Small).sizeof} >} > >int main ( char [] [] args ) >{ > writefln(Conversion!(double,int).exists); > return 1; >} ></CODE1> > ><CODE2 compiler crash> >import std.stdio; >import std.c.stdlib; > >class Cout >{ > Cout set(int x) > { > printf("%d",x); > return this; > } > alias set opShl; >} > >int main ( char [] [] args ) >{ > Cout cout = new Cout; > cout << 5 << 4; > writefln,getch; > return 1; >} ></CODE2> |
Copyright © 1999-2021 by the D Language Foundation