I dissent. The majority opinion assumes that the bequests to the charitable institutions were invalid *619and that the problem resolves itself into determining whether the heirs or the residuary legatees should receive the property. There can be no question, however, as to whom such property shall go until it is first determined whether the gift to the charities is invalid. Section 41 of the Probate Code as amended in 1937 provides as follows: “No estate, real or personal, may.be bequeathed or devised to any charitable or benevolent society or corporation, or to any person or persons in trust for charitable uses, by a testator who leaves a spouse, brother, sister, nephew, niece, descendant or ancestor surviving him, who, under the will, or the laws of succession, would otherwise have taken the property so bequeathed or devised, unless the will was duly executed at least thirty days before the death of the testator. If so executed at least thirty days before death, such devices [sic] and legacies shall be valid, but they may not collectively exceed one-third of the testator’s estate as against his spouse, brother, sister, nephew, niece, descendant or ancestor, who would otherwise, as aforesaid, have taken the excess over one-third, and if they do, a pro rata deduction from such devises and legacies shall be made so as to reduce the aggregate thereof to one-third of the estate. All property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator, if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator’s estate shall go in accordance with his will and such devises and legacies shall be unaffected.”
A bequest to charity is invalid under this section only if, in addition to the death of the testator within thirty days after the execution of the will, the testator leaves surviving him designated heirs, “who under the will, or the laws of succession, would otherwise have taken the property so bequeathed.” The death of the testator within the thirty-day period and the survival of the designated heirs are not alone sufficient to invalidate the bequest. There remains the question whether the named heirs would “otherwise” have taken the property under the will, or the laws of succession “but for such devises or legacies.” In other words, if the charitable bequests had not been made, to whom would the property go under the will, or, if the will does not cover this contingency, to whom would the property go under the laws of succession? If the property would go to spouse, brother, sister, nephew, niece, *620descendant or ancestor the bequest to charity is invalid. If it would not go to any of these but to more remote kin or strangers to the blood it is valid. The property cannot go to the designated heirs, and the charitable bequest is therefore valid if (a) the testator does not leave surviving him a nephew, niece or nearer heir (Estate of Mautner, 38 Cal. App. (2d) 521 [101 P. (2d) 520]; see Estate of Garthwaite, 131 Cal. App. 321 [21 P. (2d) 465] for the opposite rule before the 1937 amendment to section 41), or (b) if he has so framed his will that his nephews, nieces, or nearer heirs would not take what would otherwise be a defeated gift to charity.
Under section 41 as it read before the 1937 amendment, a void charitable devise passed to the residuary devisee and not to the heirs, in the absence of a contrary provision in the will. (Estate of Russell, 150 Cal. 604 [89 Pac. 345].) The 1937 amendment to section 41 makes it plain that charitable bequests and devises are no longer to be sacrificed to the enrichment of residuary bequests or devises given to strangers to the blood or to heirs more remote than nephew and niece. That purpose is clearly set forth in section 41 as follows: “All property bequeathed or devised contrary to the provisions of this section shall go to the spouse, brother, sister, nephew, niece, descendant or ancestor of the testator, if and to the extent that they would have taken said property as aforesaid but for such devises or legacies; otherwise the testator’s estate shall go in accordance with his will and such devises and legacies shall be unaffected. ’ ’ The same result is accomplished by that portion of section 42 reading as follows: “Bequests and devises . . . made by a testator leaving no spouse, brother, sister, nephew, niece, descendant or ancestor surviving by whom the property so bequeathed or devised would have been taken if said property had not been so bequeathed or devised, are excepted from the restrictions of this article. ’' If none of the designated heirs can take the property, the restrictions on charitable bequests do not apply and the property goes in accordance with the testator’s will. The very reasons therefore that exclude the heirs make a charitable bequest valid as against residuary legatees.
In the present case the decedent left nieces and nephews surviving him. The validity of the charitable bequests therefore depends upon whether the property would go to such heirs but for those bequests. If the residuary bequest to the charities had not been made there would be an intestacy as to one-fourth of the residue and the nieces and nephews would *621inherit that property under the laws of succession. That bequest therefore is invalid, and as property bequeathed contrary to the provisions of section 41, it must go to the nieces and nephews. If the specific bequest had not been made the $6,000 would be included in the residue under Probate Code, section 126, for it is not otherwise bequeathed by the testator’s will. The will contains a residuary clause, which does not include the nieces and nephews and they are not otherwise provided for in the will. It is clear therefore that the nieces and nephews cannot take such property under the will. Had there been no residuary clause they would have taken under the laws of succession and the specific bequest would therefore have been invalid. Since there is a residuary clause, however, they can take under the laws of succession only to the extent that the residuary bequests are not effective. The residuary clause left one-fourth of the residue to three charitable organizations, two of which were legatees of the $6,000 bequest. The residuary share of the charitable organization was therefore augmented by one-fourth of the $6,000 that would have gone to the other residuary legatees had the bequest to such organizations not been made. That one-fourth cannot go to the other residuary legatees because it was not bequeathed to them. It cannot go to the charitable organizations because there are heirs who would have taken under the laws of succession had it not been bequeathed to the charity. One-fourth of the $6,000 should therefore go to the nieces and nephews under the express terms of section 41 that “All property'bequeathed or devised contrary to the provisions of this section shall go to the . . . nephew, niece ... of the testator if and to the extent that they would have taken said property but for such devises or legacies.”
The remaining three-fourths of the $6,000 bequest is a valid gift to charity by reason of the following express terms of section 41: “. . . otherwise the testator’s estate shall go in accordance with his will and such . . . legacies shall be unaffected” and section 42: “Bequests . . . made by a testator leaving no . . . nephew, niece . . . surviving by whom the property so bequeathed . . . would have been taken if said property had not been so bequeathed ... are excepted from the restrictions of this article.”
It is immaterial that the charities may benefit by a reversal of the judgment although they are not appellants in *622this proceeding. If the part of a judgment appealed from is so dependent upon the remainder that it affects the whole, the appeal is from the entire judgment, and the appellate court must do as justice requires. (Estate of Murphey, 7 Cal. (2d) 712 [62 P. (2d) 374]; Whalen v. Smith, 163 Cal. 360 [125 Pac. 904, Ann. Cas. 1913E, 1319].) The present appeal cannot be limited to the determination in favor of the heirs, for that determination is dependent upon the holding that the gifts to charity are void. Furthermore, proceedings to determine to whom distribution shall be made are in rem and no judgment in personam is given in favor of one party against another. (Edlund v. Superior Court, 209 Cal. 690 [289 Pac. 841]. See, also, O’Day v. Superior Court, 18 Cal. (2d) 540 [116 P. (2d) 621]; Lilienkamp v. Superior Court, 14 Cal. (2d) 293 [93 P. (2d) 1008].) The object of the proceedings is to ascertain the persons entitled to share in the estate, and in the words of the Edlund ease, “It will not be questioned that justice and sound policy require that the estates of decedents be distributed to persons rightfully entitled thereto. ...”
The judgment should be reversed.
Edmonds, J., concurred.