Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ said, "Any person whose lineage is claimed after the death of the father to whom he is attributed, his heirs claiming him after the father has died, it is judged that if he was born of a slave woman whom the father owned at the time he had relations with her, then he is attached in lineage to the one who claims him. He has no share, however, in any inheritance that was distributed before the claim was made. As for any inheritance he reaches that has not yet been distributed, he receives his share. He is not attached in lineage if the father to whom he is attributed denied him during his lifetime. If he was born of a slave woman the father did not own, or of a free woman with whom he had committed fornication, then he is not attached in lineage and does not inherit. Even if the man to whom he is attributed himself claimed him, he is a child of fornication, belonging to his mother's people, whether they be free or slaves."Muhammad bin Rashid said, "He means by this whatever inheritance had been distributed during the Jahiliyyah, before Islam."

Azami 6061

Hasan

عن عمرو بن شعيب، عن أبيه، عن جده

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

الأعظمي 6061حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Obligatory duties
Section
Inheritance of the child of lian and the child of adultery
Numbering
Jami al-Kamil 6061 (2nd edition)
Azami 6061