The Prophet ﷺ was asked about the children of the polytheists. He replied, "Allah knows best what they would have done."
سئل النبي ﷺ عن ذراري المشركين فقال: الله أعلم بما كانوا عاملين.
Bukhari narrated it in the Book of Funerals (1384), and Muslim in the Book of Divine Decree (2659), both from Abu Yaman, who said, Shuayb informed us, from Ibn Shihab Zuhri, who said, Ata bin Yazid Laythi informed me that he heard Abu Hurairah, and he related the hadith. Their wording is the same.