Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.2.1
-
None
-
GDB
-
fb213b5826519fed277487b296fc3504bf44de76
Description
struct Base1 { virtual ~Base1() {} int foo = 42; }; struct Base2 { virtual ~Base2() {} int bar = 43; }; struct Derived : Base1, Base2 { int baz = 84; }; struct Container { Container(Base2 *b) : b2(b) {} Base2 *b2; }; int main(int argc, char *argv[]) { Derived d; Container c(&d); // c.b2 has wrong address Base2 *b2 = &d; // This has the right address return 0; }
If I understand correctly, the container calls nativeDynamicType, which uses direct casting, while the other one doesn't reach there.