It is narrated from Imam Zuhri, may Allah have mercy on him, that Ali bin Husayn, may Allah have mercy on him, did not consider a child of adultery to be an heir, even if a man continued to claim him.
Hadith Referenceسنن دارمي / من كتاب الفرائض / 3138