“If a child utters a sound (after being born), the funeral prayer should be offered for him and (his relatives) may inherit from him.”
Sunan Ibn Majah Book 6, Hadith 76