“Indifferentism” is the belief that it does not matter what religion a man professes, he can be saved nonetheless. The Church has roundly condemned this notion as a heresy in very strong language, holding it to be a denial of extra ecclesiam nulla salus. Here, we feature a brief passage from Mirari Vos, by the last great monk-pope, Gregory XVI (August 15, 1832). All emphasis (bold and italics), paragraph numbers, and reference numbers as in original on the Papal Encyclicals site; please go there to see the references.
13. Now We consider another abundant source of the evils with which the Church is afflicted at present: indifferentism. This perverse opinion is spread on all sides by the fraud of the wicked who claim that it is possible to obtain the eternal salvation of the soul by the profession of any kind of religion, as long as morality is maintained. Surely, in so clear a matter, you will drive this deadly error far from the people committed to your care. With the admonition of the apostle that “there is one God, one faith, one baptism” may those fear who contrive the notion that the safe harbor of salvation is open to persons of any religion whatever. They should consider the testimony of Christ Himself that “those who are not with Christ are against Him,” and that they disperse unhappily who do not gather with Him. Therefore “without a doubt, they will perish forever, unless they hold the Catholic faith whole and inviolate.” Let them hear Jerome who, while the Church was torn into three parts by schism, tells us that whenever someone tried to persuade him to join his group he always exclaimed: “He who is for the See of Peter is for me.” A schismatic flatters himself falsely if he asserts that he, too, has been washed in the waters of regeneration. Indeed Augustine would reply to such a man: “The branch has the same form when it has been cut off from the vine; but of what profit for it is the form, if it does not live from the root?”
14. This shameful font of indifferentism gives rise to that absurd and erroneous proposition which claims that liberty of conscience must be maintained for everyone. It spreads ruin in sacred and civil affairs, though some repeat over and over again with the greatest impudence that some advantage accrues to religion from it. “But the death of the soul is worse than freedom of error,” as Augustine was wont to say. When all restraints are removed by which men are kept on the narrow path of truth, their nature, which is already inclined to evil, propels them to ruin. Then truly “the bottomless pit” is open from which John saw smoke ascending which obscured the sun, and out of which locusts flew forth to devastate the earth. Thence comes transformation of minds, corruption of youths, contempt of sacred things and holy laws — in other words, a pestilence more deadly to the state than any other. Experience shows, even from earliest times, that cities renowned for wealth, dominion, and glory perished as a result of this single evil, namely immoderate freedom of opinion, license of free speech, and desire for novelty.
— Pope Gregory XVI, Mirari Vos