Vatican I: Schema on the Church of Christ
"Furthermore, it is a dogma of faith that no one can be saved outside the Church. Nevertheless, those who are invincibly ignorant of Christ and the Church are not to be judged worthy of eternal punishment because of this ignorance. For they are innocent in the eyes of the Lord of any fault in this matter. God wishes all men to be saved and to come to a knowledge of the truth; and if one does what he can, God does not withhold the grace for him to obtain eternal life. But no one obtains eternal life if he dies separated from the unity of faith or from communion with the Church through his own fault." (Schema on the Church of Christ: Chapter 7, presented to the Fathers of the Council on April 24, 1870).
(Chapter 1: The Dignity of the Human Person)
All this holds true not only for Christians, but for all men of good will in whose hearts grace works in an unseen way.(31) For, since Christ died for all men,(32) and since the ultimate vocation of man is in fact one, and divine, we ought to believe that the Holy Spirit in a manner known only to God offers to every man the possibility of being associated with this paschal mystery (Gaudium et Spes, no. 22).