St. John Vianney said that Voltaire did repent and was sorry for his sins and spent his last hours begging for mercy and apologizing to God, but it was too late for him, for God had abandoned him and he had to go to hell.
But there are many kinds of FALSE repentance (i.e. I'm sorry that my sins have caused me (and not God) suffering) and FALSE sorrow for sins. God reads all hearts, so He would know Voltaire's true sentiments.
.
Besides, we don't know that Voltaire is in hell. God could have forgiven his sins, but not provided him a priest, as a punishment (i.e. lack of Extreme Unction = longer time in purgatory). Or, maybe God (in His infinite wisdom and mercy) did not send a priest because He knew that Voltaire needed to be scared of hell, and to experience desolation. If a priest had come, Voltaire's sorrow might have been less or too casual, or not genuine.
.
On the other hand, St John's point with this story is that we cannot and should not wait for our death bed to convert. As Jesus told us in Scripture,
"Not every one that saith to me, Lord, Lord, shall enter into the kingdom of heaven: but he that doth the will of my Father who is in heaven, he shall enter into the kingdom of heaven".
Since St John is not here to explain further, what we can say is that God forgives all TRUE repentance and sorrow. Only God knows who that applies to.