Ergo, some like St. Robert Bellarmine have argued for example if a pope were to teach heresy, he would immediately cease to be a pope; others have argued it impossible for a pope to ever teach heresy at all as this was something they believed God wouldn't allow.
So, if you were to see someone claiming to be pope and teaching error on infallible issues of faith and morals, you'd have to conclude logically they could not be a Catholic pope, from a Catholic standpoint.