3 It remains for us to inquire, whether those who, prior to the coming of Christ in His Church to the Gentiles and to their hearing of His Gospel, have been, or are now being, overtaken by the close of this life, can have such an excuse? Evidently they can, but not on that account can they escape damnation. “For as many as have sinned without the law, shall also perish without the law; and as many as have sinned in the law, shall be judged by the law.” And these words of the apostle, inasmuch as his saying, “they shall perish,” has a more terrible sound than when he says, “they shall be judged,” seem to show that such an excuse can not only avail them nothing, but even becomes an additional aggravation. For those that excuse themselves because they did not hear, “shall perish without the law.”
Source: Tractates on the Gospel of John (New Advent)