From e4ba50055c42f4b0dc67369dfcffd8a1526c7821 Mon Sep 17 00:00:00 2001 From: Henning Pohl Date: Mon, 12 Aug 2013 13:19:56 +0200 Subject: [PATCH] add test cases for issues 10497 and 10793 --- test/runnable/casting.d | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/runnable/casting.d b/test/runnable/casting.d index 557cb6a334b3..df6c37ac4fb2 100644 --- a/test/runnable/casting.d +++ b/test/runnable/casting.d @@ -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 @@ -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 @@ -74,6 +102,7 @@ int main() test8119(); test8645(); test10646(); + test10793(); test10834(); printf("Success\n");