so, the fix is to add the pointer to B to the function signature, like void func(A* a, B* b), right?
Its unclear what you want to achieve, if you tell us that, perhaps we can tell you how to fix it.
Can someone give me an example when dynamic_cast is not broken?
It can be used to safely downcast a pointer for example, but its uses are more rare than you seem to expect.