| 1 |
// https://issues.dlang.org/show_bug.cgi?id=19754 |
| 2 |
|
| 3 |
void test19754() |
| 4 |
{ |
| 5 |
shared int x; |
| 6 |
static assert((cast(int*) &x) == &(cast() x)); |
| 7 |
(cast() x) = 5; |
| 8 |
(cast() x) += 3; |
| 9 |
|
| 10 |
const int x1; |
| 11 |
static assert(&x1 == &(cast() x1)); |
| 12 |
(cast() x1) = 5; |
| 13 |
(cast() x1) *= 3; |
| 14 |
|
| 15 |
immutable int x2; |
| 16 |
static assert(&x2 == &(cast() x2)); |
| 17 |
(cast() x2) = 5; |
| 18 |
(cast() x2) &= 3; |
| 19 |
|
| 20 |
int[4] a; |
| 21 |
(cast(long[2]) a)[0] = 5; |
| 22 |
(cast(long[2]) a)[0] += 3; |
| 23 |
|
| 24 |
static if (is(__vector(int[4]))) |
| 25 |
{ |
| 26 |
__vector(int[4]) v; |
| 27 |
(cast(int[4]) v)[0] = 5; |
| 28 |
(cast(int[4]) v)[0] += 3; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
// https://issues.dlang.org/show_bug.cgi?id=20608 |
| 33 |
|
| 34 |
void foo(T...)(auto ref T args) {} |
| 35 |
|
| 36 |
struct Tuple |
| 37 |
{ |
| 38 |
int expand; |
| 39 |
} |
| 40 |
|
| 41 |
void test20608() |
| 42 |
{ |
| 43 |
enum tup = Tuple(); |
| 44 |
foo(tup.expand); |
| 45 |
} |