The Church Fathers had preached countless sermons to the faithful in the early years of Christianity, and sometimes proposed theories that a catechumen might be able to attain eternal life without actually having received baptism, or rather by being baptized spiritually after they had died, so long as their lack of baptism was not due to their own negligence in acquiring the sacrament. It is important to note, however, that even if all these Fathers at one point held to this belief, it was never taught so constantly and so uniformly as to constitute Divine revelation, and many of these Fathers also taught the opposite on several occasions - that unbaptized catechumens were on the road to hell, irrevocably, save for the sacrament of baptism. If baptism of desire or baptism of blood were Divinely revealed contents of the deposit of faith, then they would be heretics for ever teaching the absolute necessity of water baptism.
Now it happens that these theories, know today as baptism of desire and baptism of blood, are in fact not true. After the Patristic Era, the Church made a series of several dogmatic decrees, which eliminated any lawful belief in baptism of desire, or baptism of blood.
Let us see what the Solemn Magisterium has to say, starting with the most recent decrees.
Pope Pius IX, Vatican Council, Solemn Profession of Faith, AD 1870, ex cathedra: "I, Pius, bishop of the Catholic Church, with firm faith believe and profess [...] that there are seven sacraments of the new law, truly and properly so called, instituted by our lord Jesus Christ and necessary for salvation, though each person need not receive them all."
The pope, from the Chair of St. Peter, is professing and defining the religion that he is the head of, and anyone claiming the name Christian who rejects any part of his profession is a heretic.
Pope Pius IX professes that sacraments are required for salvation, though each person need not receive them ALL. So it clearly follows that at least one sacrament must be received.
Note that he did not say, "necessary for salvation, though each person need not ACTUALLY PHYSICALLY receive them," but this is the position that baptism of desire people argue. However baptism of desire is NOT a sacrament, nor is there any true and natural water involved.
Pope Paul III, Council of Trent, Session VII, Canons on Baptism, Canon II, AD 1547, ex cathedra: "If any one saith, that true and natural water is not of necessity for baptism, and, on that account, wrests, to some sort of metaphor, those words of our Lord Jesus Christ; Unless a man be born again of water and the Holy Ghost; let him be anathema."
So the sacrament of baptism is dogmatically defined as being the sacrament of water baptism. Not spiritual water, not heavenly water, but pure and natural water, and in this, the Council simply echoed a previously defined dogma.
Pope Eugene IV, Council of Florence, Session 8, AD 1439, ex cathedra: "Holy baptism holds the first place among all the sacraments, for it is the gate of the spiritual life; through it we become members of Christ and of the body of the church. Since death came into the world through one person, unless we are born again of water and the spirit, we cannot, as Truth says, enter the kingdom of heaven. The matter of this sacrament is true and natural water, either hot or cold. The form is: I baptize you in the name of the Father and of the Son and of the holy Spirit."
Pope Eugene IV, Council of Florence, Session 8, AD 1439, ex cathedra:All these sacraments are made up of three elements: namely, things as the matter, words as the form, and the person of the minister who confers the sacrament with the intention of doing what the church does. If any of these is lacking, the sacrament is not effected."
Matter (water), form (the words) and minister (someone to speak the words and apply the water) must be present, or there is no sacrament effected.
Similarly, nobody who has not yet been baptized in water, can possibly attain sanctification, justification or salvation, even if they shed blood in the name of Christ:
Pope Eugene IV, Council of Florence, Session 11, AD 1442, ex cathedra: "It firmly believes, professes and preaches that all those who are outside the Catholic church, not only pagans but also Jєωs or heretics and schismatics, cannot share in eternal life and will go into the everlasting fire which was prepared for the devil and his angels, unless they are joined to the Catholic Church before the end of their lives; that the unity of the ecclesiastical body is of such importance that only for those who abide in it do the church's sacraments contribute to salvation and do fasts, almsgiving and other works of piety and practices of the Christian militia produce eternal rewards; and that nobody can be saved, no matter how much he has given away in alms and even if he has shed his blood in the name of Christ, unless he has persevered in the bosom and the unity of the Catholic Church."
Pope Clement V, Council of Vienne, AD 1311-1313, ex cathedra: "All are faithfully to profess that there is one baptism which regenerates all those baptized in Christ, just as there is one God and one faith'. We believe that when baptism is administered in water in the name of the Father and of the Son and of the holy Spirit, it is a perfect means of salvation for both adults and children."
So there is only ONE baptism, baptism in water, that regenerates ALL who are baptized in Christ. Baptism in water is a perfect means of salvation (in that it remits all guilt and temporal punishment due to sin, as opposed to penance, for example which is an imperfect means, remitting only the guilt, but not the punishment of the sins confessed).
Baptism of desire heretics try to argue that if baptism of desire really were heresy, then this means that the Church Fathers were heretics. This is not so at all, rather this simply manifests the nature of humanity, that we are capable of falling into errors, and that it is only God who can provide the light we need to see clearly, especially in matters relating to faith. And this light, He does indeed provide, in accordance with His promise to St. Peter and the Apostles.
St. Luke 22:31-32: "And the Lord said: Simon, Simon, behold Satan hath desired to have you, that he may sift you as wheat: But I have prayed for thee, that thy faith fail not: and thou, being once converted, confirm thy brethren."
St. John 16:13: "But when he, the Spirit of truth, is come, he will teach you all truth. For he shall not speak of himself; but what things soever he shall hear, he shall speak; and the things that are to come, he shall shew you."
Acts of the Apostles 1:8: "But you shall receive the power of the Holy Ghost coming upon you, and you shall be witnesses unto me in Jerusalem, and in all Judea, and Samaria, and even to the uttermost part of the earth."
God provides this light by the ex cathedra decrees of the Holy See.
Without faith in Jesus Christ, nobody is saved, and no person who is yet unbaptized has this faith.
Pope Eugene IV, Council of Florence, Session 11, AD 1442, ex cathedra: "It firmly believes, professes and preaches that never was anyone, conceived by a man and a woman, liberated from the devil's dominion except by faith in our lord Jesus Christ"
Pope Paul III, Council of Trent, Session VI, Decree on Justification, Chapter VII, AD 1547, ex cathedra: "This faith, catechumens beg of the Church - agreeably to a tradition of the apostles - previously to the sacrament of Baptism."
St. Thomas Aquinas died after the Patristic Era and before the decrees of the Holy See, which rendered his erroneous doctrine heretical.