Has any pope ever declared a pope that came before him a heretic?
And if so, would this have any negative bearing on papal infallibility?
It is certain that a pope can be a private and material heretic, at least where material is taken both subjectively and objectively. By subjectively we mean someone holding a position in fact contrary to the deposit of faith, but he is erring in good faith. Frankly all or almost all of us are or have been materially heretical in that sense--- surely people think wrong things about the Trinity or Incarnation or predestination without ever being obstinate against the Church. By materially objectively I mean at times there is no definitive teaching about some matter, either through formal definition or universal witness, though the matter is or can be eventually defined. Hence the proposition that "the blessed do not see God until after the general resurrection" was materially heretical before Benedict XII issued the Bull Benedictus Deus where he defined that they do. That proposition is now formally heretical, being opposed to something explicitly held by the Church as de fide. Though an individual holding it might just be confused and in good faith and hence a material heretic, the proposition itself is formally heretical.
Why did I use that example? Because the pope prior to Jacques Fournier (Benedict XII), was John XXII who taught, as his opinion, not as binding, that the blessed do not see God until after. Jacques d'Euse (John XXII) was certainly a material heretic in both senses described.
It is certain that a pope could never be a formal and public heretic. It is also certain that a pope could never be a material (in the subjective, but not objective sense) and public heretic. Though it is not certain that he could not be a private heretic, even formal. Public heresy, even if subjectively material, deprives one of actual membership in the Church by its very nature. The head of the Church cannot be a non-member. The common teaching, e.g. in Bellarmine, is that in God's providence, rather than losing his office, such would never happen, since the visible unity of the Church would be threatened