Skip to content

Inheritance & Dynamic Casting Quickstart example crashesΒ #127

@Medality

Description

@Medality

Hi,

I followed the Inheritance & Dynamic Casting Quickstart example. The upcast is working correctly but the dynamic_cast crashes:
Mock<C> cMock;
When(Method(cMock, foo)).AlwaysReturn(0);
A& a = cMock.get(); // get instance and upcast to A&
B& b = dynamic_cast<B&>(a); // downcast to B& --> Crash!

I'm using Visual Studio 2015 Update 3 on Windows 10.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions