This patch attempts to fix PR34451.
The getBestDynamicClassType call can only handle RecordDecls and pointers to RecordDecls. The code removed all the implicit casts, this includes the array to pointer decay. After removing the decay, the checker passed an array type to getBestDynamicClassType which triggered the assertion.