fix Issue 6539 - Incomprehensible error message with failed template instantiation