mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
38 lines
510 B
D
38 lines
510 B
D
/*
|
|
REQUIRED_ARGS: -release -check=assert=on
|
|
PERMUTE_ARGS: -check=invariant=on
|
|
*/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=22945
|
|
|
|
bool hitStruct;
|
|
bool hitClass;
|
|
|
|
struct S
|
|
{
|
|
this(int) {}
|
|
invariant { hitStruct = true; }
|
|
}
|
|
|
|
class C
|
|
{
|
|
this() {}
|
|
invariant { hitClass = true; }
|
|
}
|
|
|
|
int main()
|
|
{
|
|
cast(void) S(0);
|
|
cast(void) new C();
|
|
|
|
version(D_Invariants)
|
|
{
|
|
assert(hitStruct && hitClass);
|
|
}
|
|
else
|
|
{
|
|
assert(!hitStruct && !hitClass);
|
|
}
|
|
|
|
return 0;
|
|
}
|