Deductions & credits

Publication 501 says that a child has the residency of the parents.  It could be superseded by something else in publication 551, I suppose. But how would the substantial presence test ever apply to a newborn anyway?