https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106259
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I know, in principle, how to fix it, but currently I'm struggling with getting struct A<T>::W<U> from struct A<int>::W<U> That we haven't found struct A<int>::W<U> in class2loc is actually OK, we don't have a A<int> specialization, so we should see if W in the primary template A was defined with class or struct.