fix Issue 9050 - Too early instantiation of template structs