https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89087
--- Comment #1 from Martin Storsjö <martin at martin dot st> --- FWIW, Clang (when operating in MinGW mode, where it tries to follow what GCC does) also had the same issue. There this issue was fixed by emitting definitions for nested classes even if a template instantiation has been declared, like this: https://github.com/llvm-project/clang/commit/7331c3301af9628719664c9a4feea576df3994a9