Sunan Ibn Majah 1523: Chapters Regarding Funerals
It was narrated that Ibn ‘Umar said: “When ‘Abdullah bin Ubayy died, his son came to the Prophet (saw) and said: ‘O Messenger of Allah (saw), give me your shirt so that I may shroud him in it.’ The Messenger of Allah (saw) said: ‘Notify me when he is ready (i.e., when he has been washed and shrouded).’ When the Prophet (saw) wanted to offer the funeral prayer for him: ‘You should not do that.’ The Prophet (saw) offered the funeral prayer for him, and the Prophet (saw) said to him: ‘I have been given two choices: “...ask forgiveness for them (hypocrites) or ask not forgiveness for them...’” [9:80] Then Allah revealed: ‘And never pray (the funeral prayer) for any of them (hypocrites) who dies, nor stand at his grave.’” [9:]
English translation, translator not named, from an open hadith text collection