| 1 |
/* REQUIRED_ARGS: -O -fPIC |
| 2 |
* DISABLED: win32 win64 |
| 3 |
*/ |
| 4 |
// https://issues.dlang.org/show_bug.cgi?id=20466 |
| 5 |
|
| 6 |
extern (C++) final class Parameter |
| 7 |
{ |
| 8 |
ulong storageClass; |
| 9 |
void* type; |
| 10 |
} |
| 11 |
|
| 12 |
extern (C++) final class IfStatement |
| 13 |
{ |
| 14 |
Parameter prm; |
| 15 |
} |
| 16 |
|
| 17 |
extern (C++) final class Visitor |
| 18 |
{ |
| 19 |
void visit(IfStatement s) |
| 20 |
{ |
| 21 |
if (Parameter p = s.prm) |
| 22 |
{ |
| 23 |
ulong stc = p.storageClass; |
| 24 |
if (!p.type && !stc) |
| 25 |
stc = 1L << 8; |
| 26 |
assert(!(stc & (1L << 34))); |
| 27 |
} |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
int main() |
| 32 |
{ |
| 33 |
auto p = new Parameter; |
| 34 |
p.storageClass = 1L << 2; |
| 35 |
auto s = new IfStatement; |
| 36 |
s.prm = p; |
| 37 |
auto v = new Visitor; |
| 38 |
v.visit(s); |
| 39 |
return 0; |
| 40 |
} |