So much for that "the gates of hell will not prevail against it" claim Catholics are so fond of making.
The Church does indeed denote the "Gates of Hell' as heresy and as such Divine Law and the Church Herself has specifically protected her flock from false shepherds.
I just posted one example to the thread but it is still waiting to be approved. If you want other examples just check my comments or I'll post some more tomorrow.
As for the present situation, no matter if those in the hierarchy may defect, and most of the flock blindly follow, the Church still remains in any individual soul who holds the Faith revealed by Christ whole and entire.
Just for the record, it was Our Lord who promised it, so you'll have to take it up with Him:
And I say to thee: That thou art Peter; and upon this rock I will build my church, and the gates of hell shall not prevail against it.