Skip to content

Commit

Permalink
Merge pull request #2466 from hpohl/10793
Browse files Browse the repository at this point in the history
add test cases for issues 10497 and 10793
  • Loading branch information
WalterBright committed Aug 18, 2013
2 parents 13a0da4 + e4ba500 commit 7a3dd01
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/runnable/casting.d
Expand Up @@ -32,6 +32,17 @@ void test8645()
static assert(!is(typeof( cast(Foo)bar )));
}

/***************************************************/
// 10497

struct S10497;

void test10497(S10497** s)
{
void* ptr;
*s = cast(S10497*)ptr;
}

/***************************************************/
// 10646

Expand All @@ -46,6 +57,23 @@ void test10646()
static assert(!__traits(compiles, { auto c2 = cast(C)css; }));
}

/***************************************************/
// 10793

struct RealFoo10793
{
int i;
}

struct Foo10793;

void test10793()
{
auto rf = RealFoo10793(10);
void* prf = cast(void*)&rf;
Foo10793* f = cast(Foo10793*)prf;
}

/***************************************************/
// 10834

Expand Down Expand Up @@ -74,6 +102,7 @@ int main()
test8119();
test8645();
test10646();
test10793();
test10834();

printf("Success\n");
Expand Down

0 comments on commit 7a3dd01

Please sign in to comment.