Both the Syllabus of Errors and the Oath Against Modernism condemn the ideas that 1) a man may be saved in a false religion and 2) that a good-willed man, who follows the natural law, can have supernatural Faith, which saves.
Syllabus of Errors – Bl Pope Pius IX - 1864
16. Man may, in the observance of any religion whatever, find the way of eternal salvation, and arrive at eternal salvation. — Encyclical “Qui pluribus,” Nov. 9, 1846.
Pope St Pius X's "Oath Against Modernism" of 1910
Fifthly, I hold with certainty and sincerely confess that faith is not a blind sentiment of religion welling up from the depths of the subconscious under the impulse of the heart and the motion of a will trained to morality; but faith is a genuine assent of the intellect to truth received by hearing from an external source.
By this assent, because of the authority of the supremely truthful God, we believe to be true that which has been revealed and attested to by a personal God, our creator and lord.