Abdullah bin Umar reported,

An Arabi came to the Prophet ﷺ and said, "Messenger of Allah, my father used to maintain ties of kinship, and he used to do such and such. Where is he now?"He replied, "In the Fire."The man seemed troubled by this and asked, "Messenger of Allah, then where is your father?"The Messenger of Allah ﷺ said, "Whenever you pass by the grave of a polytheist, give him tidings of the Fire."The Arabi later embraced Islam and said, "The Messenger of Allah ﷺ has burdened me with a tiring task. I never pass by the grave of a disbeliever without giving him tidings of the Fire."

Azami 3906

Sahih

عن عبد الله بن عمر قال

جاء أعرابي إلى النبي ﷺ فقال: يا رسول الله، إن أبي كان يصل الرحم، وكان وكان، فأين هو؟ قال: في النار. قال: فكأنه وجد من ذلك فقال: يا رسول الله، فأين أبوك؟ فقال رسول الله ﷺ: حيثما مررت بقبر مشرك فبشره بالنار. قال: فأسلم الأعرابي بعد، وقال: لقد كلفني رسول الله ﷺ تعبا، ما مررت بقبر كافر إلا بشرته بالنار.

الأعظمي 3906صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Visiting graves
Section
One who visits the grave of a disbeliever should not supplicate for him, but rather give him tidings of the Fire
Numbering
Jami al-Kamil 3906 (2nd edition)
Azami 3906