Do all baptized babies that die in infancy go to heaven? Do all unbaptized infants that die go to heaven? That is the question and the answer is????????
The answer is, from a strictly dogmatic standpoint, as Cronos said, “We don’t know for certain”.
But as the catechism clearly states, we are permitted to believe they do.
This may not be a satisfactory answer for you, and if so, I’m sorry. You must understand the subtlety of the situation here. You are asking a question that demands both a dogmatic reply and a personal reply.
Put another way, if I’m in a theological debate and I’m asked that question, I will answer, “The Church cannot say for certain as a matter of dogma”
But if a grieving mother asks me the same question, I would answer, “I’m sure your baby is in Heaven”
You may, at this juncture retort, “But that is contradictory; you can’t have both answers be true.”
Both answers can be true though because, one is answering a theological charge, who’s only purpose can be to trap the Church in some theological mistake, while the other is asking an honest, truly human question, that has a truly human need attached.
This is actually why the Church is quite reticent to define anything dogmatically until and unless there is sufficient reason to do so. There will always be some who seek to trap Her with her own words.
I don’t know your motivation for asking the question, since I can’t read minds, which is why I gave both answers.