digitalmars.D.bugs - [DMD 0.101] Version statement without else clause within if crashes
- Burton Radons (9/9) Sep 19 2004 This code causes the compiler to crash:
- Lars Ivar Igesund (10/21) Sep 19 2004 I think this leads to an incorrect program, as version (none) becomes
-
Stewart Gordon
(22/39)
Sep 28 2004
- Walter (2/2) Sep 19 2004 It's fixed now. It turns into:
- Stewart Gordon (3/5) Sep 27 2004 You mean you've changed it so that that's valid D syntax?
- Walter (4/10) Sep 30 2004 No. I meant:
This code causes the compiler to crash: void foo () { if (x) version (none) foo; } The specification doesn't say what a collapsed version/debug statement turns into, so I don't know how it's supposed to behave.
Sep 19 2004
Burton Radons wrote:This code causes the compiler to crash: void foo () { if (x) version (none) foo; } The specification doesn't say what a collapsed version/debug statement turns into, so I don't know how it's supposed to behave.I think this leads to an incorrect program, as version (none) becomes nothing: void foo () { if (x) } which is wrong because there is no statement following if (x). The compiler shouldn't crash, though. Lars Ivar Igesund
Sep 19 2004
In article <cikkvs$1f9n$1 digitaldaemon.com>, Lars Ivar Igesund says...Burton Radons wrote:<snip>This code causes the compiler to crash: void foo () { if (x) version (none) foo; }void foo () { if (x) } which is wrong because there is no statement following if (x). The compiler shouldn't crash, though.The D versioning system isn't a text preprocessor. As such, it is pointless to try and think of version blocks as reducing to textual nothingness. Rather, it reduces to semantic nothingness, an effective 'nop' statement. Another way to think of it is by imagining that there are braces: void foo() { if (x) { version (none) { foo; } } } The statement forms if ( Expression ) Statement if ( Expression ) { Statement } are identical in effect, By converting to the latter, it is easy to see the result of version reduction. Stewart.
Sep 28 2004
In article <cil2q3$1l6i$1 digitaldaemon.com>, Walter says...It's fixed now. It turns into: if (x) ;You mean you've changed it so that that's valid D syntax? Stewart.
Sep 27 2004
"Stewart Gordon" <Stewart_member pathlink.com> wrote in message news:cj9ltc$16k1$1 digitaldaemon.com...In article <cil2q3$1l6i$1 digitaldaemon.com>, Walter says...No. I meant: if (x) { }It's fixed now. It turns into: if (x) ;You mean you've changed it so that that's valid D syntax?
Sep 30 2004