I found below code in /usr/include/QtCore/qglobal.h.
It comes from tagfile: GCC-4.8.2-x86_64-redhat-linux.vtg
I added an #undef of QT_NO_DYNAMIC_CAST into preprocessing and rebuilt the GCC-4.8.2-x86_64-redhat-linux.vtg
Now it does find the right type, DerivedClass*
Strange thing is that there were other auto var = dynamic_cast<> in my codebase where the SE was correctly figuring out the type. Don't know why it worked sometimes and not others.
I suppose it is working now for me but would be nice is somehow SE got around this issue, or at least gave some indication to the user so they could easily find this issue and know to do an #undef.
Here is the code in /usr/include/QtCore/qglobal.h:
#ifdef QT_NO_DYNAMIC_CAST
# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
template<typename T, typename X>
T qt_dynamic_cast_check(X, T* = 0)
{ return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
#endif