fix Issue 9861 - Spurious 'is used as type' error with failed template instantiation