Functions returning void can't be executed at compile time, even if they have out/inout parameters: --- urxae@urxae:~/tmp$ cat test.d void bar(out int x) { x = 2; } int foo() { int y; bar(y); return y; } const int z = foo(); void main(){} urxae@urxae:~/tmp$ dmd test.d test.d(3): Error: cannot evaluate bar(y) at compile time test.d(5): Error: cannot evaluate foo() at compile time --- If bar returns an unused int it compiles fine: --- urxae@urxae:~/tmp$ cat test.d int bar(out int x) { x = 2; return 1; } int foo() { int y; bar(y); return y; } const int z = foo(); void main(){} urxae@urxae:~/tmp$ dmd test.d gcc test.o -o test -m32 -lphobos -lpthread -lm -Xlinker -L/home/urxae/opt/dmd/lib ---
Fixed DMD 1.009
Added to DStress as http://dstress.kuehne.cn/compile/i/inerpret_05_A.d http://dstress.kuehne.cn/compile/i/inerpret_05_B.d
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル