Zuhri reported,

Ata bin Yazid reported that Abu Hurairah said that the Messenger of Allah ﷺ was asked about the children of the polytheists, and he replied, "Allah knows best what they would have done."

Muslim 6763

Sahih

حدثنا عبد بن حميد أخبرنا عبد الرزاق أخبرنا معمر ح و حدثنا عبد الله بن عبد الرحمن بن بهرام أخبرنا أبو اليمان أخبرنا شعيب ح و حدثنا سلمة بن شبيب حدثنا الحسن بن أعين حدثنا معقل وهو ابن عبيد الله كلهم عن الزهري بإسناد يونس وابن أبي ذئب مثل حديثهما غير أن في حديث شعيب ومعقل سئل عن ذراري المشركين

مسلم 6763صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Decree
Chapter
Meaning of "every child is born upon fitrah" and the ruling on the death of children of disbelievers and children of Muslims
Numbering
Darussalam 6763
Muslim 6763