I introduced a patch to handle unqualified templated base class initialization in MSVC compatibility mode: https://reviews.llvm.org/rGc894e85fc64dd8d83b460de81080fff93c5ca334
We identified a problem with this patch in the case where the base class is partially specialized, which can lead to triggering an assertion in the case of a mix between types and values.
The minimal test case is:
template <typename Type, int TSize> class Vec {}; template <int TDim> class Index : public Vec<int, TDim> { Index() : Vec() {} }; template class Index<0>;
The detailed problem is that I was using the InjectedClassNameSpecialization, to which the class template arguments were then applied in order. But in the process, we were losing all the partial specializations of the base class and creating an index mismatch between the expected and passed arguments.
Is this cast always safe? Is there a simpler way to check if the base type is a template specialization type?