| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/misc1.d(109): Error: `5` has no effect |
| 5 |
fail_compilation/misc1.d(110): Error: `1 + 2` has no effect |
| 6 |
fail_compilation/misc1.d(111): Error: `x` has no effect |
| 7 |
fail_compilation/misc1.d(117): Deprecation: `1 * 1` has no effect |
| 8 |
fail_compilation/misc1.d(118): Deprecation: `() { j++; d++; }` has no effect |
| 9 |
fail_compilation/misc1.d(124): Deprecation: `false` has no effect |
| 10 |
fail_compilation/misc1.d(127): Deprecation: `*sp++` has no effect |
| 11 |
fail_compilation/misc1.d(128): Deprecation: `j` has no effect |
| 12 |
--- |
| 13 |
*/ |
| 14 |
|
| 15 |
#line 100 |
| 16 |
|
| 17 |
/***************************************************/ |
| 18 |
//https://issues.dlang.org/show_bug.cgi?id=12490 |
| 19 |
|
| 20 |
void hasSideEffect12490(){} |
| 21 |
|
| 22 |
void issue12490() |
| 23 |
{ |
| 24 |
int x; |
| 25 |
5, hasSideEffect12490(); |
| 26 |
1 + 2, hasSideEffect12490(); |
| 27 |
x, x++; |
| 28 |
} |
| 29 |
|
| 30 |
void issue23480() |
| 31 |
{ |
| 32 |
int j; |
| 33 |
for({} j; 1*1) {} |
| 34 |
for({j=2; int d = 3;} j+d<7; {j++; d++;}) {} |
| 35 |
for ( |
| 36 |
if (true) // (o_O) |
| 37 |
assert(78); |
| 38 |
else |
| 39 |
assert(79); |
| 40 |
false; false |
| 41 |
) {} |
| 42 |
// unnecessary deref |
| 43 |
for (ubyte* sp; 0; *sp++) {} |
| 44 |
for (;; j) {} |
| 45 |
} |