From 2aeb18c118cddf8b1792631c1c8a59f452b20e1c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 26 Apr 2015 04:28:32 +0200 Subject: [PATCH] additionally cover mix-in and cross-casting cases --- tests/library/meta/access-casted-test.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/library/meta/access-casted-test.cpp b/tests/library/meta/access-casted-test.cpp index 9e012a7b4..2588fa0e8 100644 --- a/tests/library/meta/access-casted-test.cpp +++ b/tests/library/meta/access-casted-test.cpp @@ -57,7 +57,13 @@ namespace test { { virtual ~E() {}; }; - struct F : E {}; + + struct X {}; + + struct F + : X + , E + { }; using lib::test::tyAbbr; @@ -98,6 +104,8 @@ namespace test { F f; E& rEF = f; E* pEF = &f; + X* pXF = &f; + F* pF = &f; cout << "can_downcast = " << can_downcast::value < = " << can_downcast::value <" << AccessCasted::access(pEF) <" << AccessCasted::access(pEF) <" << AccessCasted::access(pEF) <" << AccessCasted::access(pF) <" << AccessCasted::access(pXF) <::access(pEF); // cross-cast not supported (to complicated to implement) + // AccessCasted::access(pXF); // downcast not possible, since X does not provide RTTI } };