Such as below. If you control the classes you can have workarounds but if you want to log a class owned by non user code something more is required.
struct Base1{};
template<typename T>
struct Base2 : public Base1
{
T t;
};
template<typename T, typename S>
struct Derived : public Base2<T>
{
S s;
struct Nested{} nested;
template<typename U>
struct Nested2{};
};
auto n = Derived<int, double>::Nested2<unsigned int>{};