Riyad as-SalihinChapter 6Hadith 254
Full Sharh — Riyad as-Salihin 254
وعن ابن عباس رَضِيَ اللَّهُ عَنهُما قال سمعت رَسُول اللَّهِ صَلَّى اللَّهُ عَلَيهِ وَسَلَّم يقول : "ما من رجل مسلم يموت فيقوم على جنازته أربعون رجلاً لا يشركون بالله شيئاً إلا شفعهم اللَّه فيه." ((رَوَاهُ مُسلِمٌ)).
English Translation
Ibn 'Abbas (May Allah be pleased with them) reported:: The Messenger of Allah (ﷺ) said, "If a Muslim dies and forty people, who do not associate anything with Allah in worship, participate in the funeral prayer over him, Allah will accept their intercession for him.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of Visiting the Sick
Hadith Number
254