Children born of parents in a void marriage are considered legitimate if, at the point of marriage, either or both spouses reasonably believed the union to be valid.
Likewise, children of voidable marriages, once they are annulled, are still deemed to be the legitimate offspring of those parents.