CCC 1259 For catechumens who die before their Baptism, their explicit desire to receive it, together with repentance for their sins, and charity, assures them the salvation that they were not able to receive through the sacrament.

CCC 1260 “Since Christ died for all, and since all men are in fact called to one and the same destiny, which is divine, we must hold that the Holy Spirit offers to all the possibility of being made partakers, in a way known to God, of the Paschal mystery.”1 Every man who is ignorant of the Gospel of Christ and of his Church, but seeks the truth and does the will of God in accordance with his understanding of it, can be saved. It may be supposed that such persons would have desired Baptism explicitly if they had known its necessity.

1 GS 22 # 5; cf. LG 16; AG 7.