In Catholicism, does baptism against the will of a dying, unaware person result in baptismal regeneration? Suppose that a hostile unbeliever meets a Catholic priest. The unbeliever is a blasphemer and firmly stated that he never wants to become a Christian. However later that day, he is dying and non compos mentis. The priest while the unbeliever does not know what he is doing, grabs him and baptized him with the baptismal formula. Immediately after he dies.

According to Catholicism, did he go to Heaven?
The baptism would not be valid.

Also the priest would be reprimanded if it was discovered.

Canon law lays down the conditions for adult baptism.


  Can. 865 §1. For an adult to be baptized, the person must have manifested the intention to receive baptism, have been instructed sufficiently about the truths of the faith and Christian obligations, and have been tested in the Christian life through the catechumenate. The adult is also to be urged to have sorrow for personal sins.
  
  §2. An adult in danger of death can be baptized if, having some
  knowledge of the principal truths of the faith, the person has
  manifested in any way at all the intention to receive baptism and
  promises to observe the commandments of the Christian religion.


Also, thanks to Ken Graham:


  Baptism can not be forced on someone. One must not baptize a person
  who has lost his or her mind, if this person didn't show their
  intention to be baptized while they were still mentally competent.
  [Summa Theologica, III, q. 68. a. 7, a. 10, a. 12].