Allow dynamic_cast to void* even with -fno-rtti.

PR17346.