struct S { int x; } int foo() { S s; bar(s); return s.x; } void bar(ref S s) { s.x = 10; } enum x = foo(); static assert(x == 10); // Fails, x is 0
This bug also applies to D1.0, replacing the 'enum' with const int x = foo();
I have fixed this in my copy of interpret.c, but it's rather more general. It allows arbitrary expressions as reference parameters. (Passing an array member by reference will result in wrong-code in DMD1.046).
I have sent Walter my patch for this, it will be in the next release.
Fixed dmd 1.047 and 2.032
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル