
441 S.W.2d 438 (1969)
EITEL et al., Appellants,
v.
JOHN N. NORTON MEMORIAL INFIRMARY et al., Appellees.
Court of Appeals of Kentucky.
May 16, 1969.
*439 Squire R. Ogden, Frank A. Logan, Lively M. Wilson, Stites and McElwain, Louisville, for appellants.
Leo T. Wolford, Ernest C. Pepples, Jr., Wyatt, Grafton & Sloss, John E. Tarrant, Richard W. Iler, Bullitt, Dawson & Tarrant, Louisville, John B. Breckinridge, Atty. Gen., Henri L. Mangeot, Deputy Atty. Gen., Frankfort, for appellees.
*440 REED, Judge.
John N. Norton Memorial Infirmary and Children's Hospital, separate hospitals and both located in Louisville, Kentucky, agreed to consolidate. This action was instituted for a declaratory judgment[1] to secure an adjudication of the legality of the consolidation and its effect on the receipt of proceeds from trusts of which the two separate institutions are beneficiaries. The chancellor rendered a carefully considered and well-reasoned opinion declaring the consolidation as formulated in the agreement by the two institutions to be in all respects valid; he further directed the trustees of the trusts involved to pay over to the consolidated institution the trust proceeds which would have been paid over to the separate institutions had no consolidation been effected; these proceeds to be received, held and administered by the new institution in accordance with the terms of the agreement of consolidation. He declared, however, that one testamentary trust terminated by reason of the consolidation. From this entire adjudication the present appeal resulted. We believe the declaratory judgment entered by the chancellor is essentially correct with certain modifications which will be indicated.
John Norton Memorial Infirmary (hereinafter called "Norton"), and Children's Hospital (hereinafter called "Children's"), are nonprofit Kentucky corporations incorporated under statutory authority existing prior to the enactment of Chapter 273 of the Kentucky Revised Statutes which is now known as the "Kentucky Nonprofit Corporation Act."[2] This latest statutory enactment became effective in 1968, and it was by virtue of its provisions that the consolidation was effected.
The appellant, Paul Eitel, is a member of the Board of Trustees of Norton; and appellant, Marshall Royce, is a member of the Board of Directors of Children's. They brought this action. Citizens Fidelity Bank and Trust Company, The First National Bank and Kentucky Trust Company are the trustees of existing charitable trusts created for the benefit of the two hospitals. These trustees are parties to this action. The Attorney General also appeared and has participated fully in the case.
Children's Hospital Foundation (hereinafter referred to as "Foundation"), was founded solely for the benefit of Children's. Its primary purpose was to hold for investment and reinvestment gifts or bequests received by it and distribute the income received therefrom to Children's. Foundation was to pay to Children's 95 percent of the income received by Foundation with 5 percent to be retained by Foundation and held by it for investment. In the event of an emergency, Foundation can pay to Children's 20 percent of the principal held. Foundation is also a party to this action as are the two corporate entities which have agreed to consolidate. With a single exception later discussed, the express terms of the trusts of which Children's is beneficiary either expressly permit consolidation or merger by Children's with another institution or do not prohibit or mention such event. This same factual situation is present in the trusts of which Norton is beneficiary.[3]
The single exception is in the trust created by virtue of the will of Mary C. Short. The express language of the Short will provides that if Children's Hospital shall
"* * * consolidate or merge with another institution (not including a simple change of name,) this trust for its benefit shall terminate, and the entire principal of the trust estate shall pass into my residuary estate and be held as a part of said estate under Item 21 hereof."
The beneficiaries of the residuary estate under Item 21 of the will are named private *441 individuals except for two charitable bequests to Kosair Crippled Children's Hospital of Louisville and the Home for the Aged of the Little Sisters of the Poor of Louisville  these two latter beneficiaries to receive one-thirteenth each of the residuary estate.
All necessary corporate action required has been properly taken. Under the agreement of consolidation, Norton, which operates a general hospital in Louisville, Kentucky, and Children's, which operates a specialized hospital in Louisville, are to be consolidated into a new corporation: Norton-Children's Hospital Inc., which will operate a general hospital for adults as the Norton Division and which will operate a specialized hospital for children as the Children's Division. Income from various funds established for one or the other of Norton or Children's, according to this agreement, will be used for the purposes of the Norton Division or the Children's Division, respectively. The agreement further provides that the new corporation will be governed by a board of directors consisting of 40 members and made up of two separate classes: the Norton class and the Children's class, each having 20 members. The Norton class will initially consist of the 20 incumbent trustees of Norton, and the Children's class will consist of the 20 incumbents of Children's. Each class will be perpetual, i. e., as vacancies occur in any class they will be filled by the remaining members of that particular class.
The first issue presented for determination is the constitutionality of the Kentucky Nonprofit Corporation Act. The only suggestion of a constitutional infirmity is a vague contention that the merger and consolidation provisions of the Act operate to impair the obligation of contracts of each of the corporations seeking to consolidate.
Neither the identity of the contractual undertakings allegedly impaired is revealed, nor the character of the impairment and the extent thereof demonstrated. We have no difficulty in concluding that our decisions in Ayers et al. v. Burley Tobacco Growers Cooperative Ass'n, Ky., 344 S.W.2d 836 and City of Covington v. Sanitation District No. 1, Ky., 301 S.W.2d 885 clearly require that the contention of constitutional invalidity be rejected. The original incorporators and contributors acquired no vested rights in perpetual retention of all provisions of the original corporate charters.[4] KRS 273.291(2) (c) and (e) provide that the liabilities and obligations of each of the constituent corporations consolidating become the responsibility and liability of the new corporation. So far as donors to the constituent corporations are concerned, the separate institutions are to be considered to have survived, as will be later held herein. Hence, we conclude that the chancellor properly adjudged that the Kentucky Nonprofit Corporation Act is not unconstitutional under either the Constitution of the United States or the Constitution of Kentucky by reason of violation of the prohibitions against impairment of the obligation of contracts.
We find those provisions in the agreement of consolidation relating to the mechanics of operation of the new corporation to be valid. Segregation into a Norton Division and Children's Division is consistent with preserving the basic purposes of the various donors in making their gifts. There is nothing in the Nonprofit Corporation Act which would prohibit such arrangement for efficient administration of the activities of the new entity. The division of the directors into two classes with each class having a separate identity with provision for self-perpetuation is consistent with KRS 273.213 which empowers the new corporation to provide how vacancies on its board of directors shall be filled.
KRS 273.291(b) provides that the separate existence of all corporations parties to the plan of consolidation except the new *442 corporation shall cease. The effect of a substantially similar statutory provision upon a substantially similar plan of consolidation by two nonprofit corporate entities has been the subject of decision in this jurisdiction. "While the statute provides that the old corporation shall cease to exist upon such consolidation, it was never intended to destroy anything except the separate identity, the shell, as it were, preserving, however, all that was vital or valuable." Central University of Kentucky v. Walters' Ex'rs, 122 Ky. 65, 90 S.W. 1066. There the dispositive holding was: "* * * the effect of the consolidation was to continue in the new corporation, * * * all the franchises, and vest in it all the property rights, subject to the terms upon which it was (sic) acquired, of the two constituent corporations * * *."[5]
The chancellor correctly adjudged the agreement of consolidation to be in all respects valid and that its effect was to vest in the new corporation all of the property rights, subject to the terms upon which they were acquired, of the two constituent corporations. The corporate directors of Norton and Children's did not breach any fiduciary duty by effecting the consolidation.
We have determined that it was proper for the chancellor to declare the rights as to the trusts for the benefit of the two constituent corporations except for the declaration attempting to make a binding disposition of the Mary C. Short trust. It was also proper to declare the duty of Foundation to continue to pay over to the new corporation the proceeds which would otherwise have been payable to Children's.
The unconditional gifts, or unconditional trusts or bequests for the benefit of Children's or Norton and represented herein are deemed vested in and payable to the new corporation whether they were made, created, or paid before or after the effective date of the consolidation. Where the only condition expressed in such instances is the continued existence of either Children's or Norton, the proceeds are likewise vested in and payable to the new corporation. Neither Children's nor Norton was annihilated by the consolidation  they were amalgamated. Cf. Scott-Lees Collegiate Institute v. Charles et al., 283 Ky. 234, 140 S.W.2d 1060.
The Restatement of Trusts, Second, Sec. 401, provides:
"(1) If it is provided by the terms of the trust that a charitable trust shall continue only until the happening of a certain event or that upon the happening of a certain event the charitable trust shall terminate, the trust terminates upon the happening of the event, unless the provision is invalid."
In the comments under this section the following illustration applicable to the instant problem is given: "Thus, where it is provided that the income from trust property shall be paid to a certain academy, but that if the academy should be dissolved or should go out of existence as an academy the trust should terminate, the condition is not broken merely because it combines with another academy to give instruction under a reciprocal agreement."[6]
In Greenway et al. v. Irvine's Trustee et al., 279 Ky. 632, 131 S.W.2d 705, 124 A.L.R. 1229, which involved a charitable trust for the benefit of a hospital, this court approved and followed what is now section 391 of the Restatement of Trusts, Second. It was held therein that where property is devised for charitable uses, the donor or a residuary legatee has no interest in the trust property except as a member of the public, and he can question the activities of the trustee only by an action preferred on behalf of himself and all others similarly situated in conjunction with the Attorney General representing the public.
*443 It appears that the Attorney General appeared and fully participated in this action; the trustees of the trusts involved were parties to the action and also fully participated. We conclude that as to all trusts so represented, except the trust of Mary C. Short, it was proper to make a declaration and the declaration made was correct.
The testamentary trust of Mary C. Short presents a different problem. The express terms of the trust itself provide for termination of the trust upon the happening of a certain event  merger or consolidation with another institution. Unlike the other trusts involved, the Short trust makes a gift over upon the happening of a certain event. If there is a valid gift over upon the failure of the trust, the person to whom the gift over is made can maintain a suit to recover the property upon the ground the trust has failed.[7]
The chancellor undertook to make a declaration of rights as to the income from the Short trust. Children's urges us to reverse his holding that the trust failed by reason of the consolidation. We will not recite or consider the several contentions advanced for reversal. When declaratory relief is sought, all persons must be made parties who have or claim any interest which would be affected by the declaration.[8] The beneficiaries named in the gift over were not made parties.[9] It was not proper for the chancellor to attempt a declaration of rights in such circumstances and we will not do so. That part of the judgment should be stricken with recitation that it is without prejudice to securing the relief sought when the proper parties are before the court.
It also follows that the provision in the judgment that "the new corporation may receive any devises, bequests or grants contained in any will or other instrument in trust or otherwise * * *" is too broad and speculative. This provision should be recast in conformity to holdings made herein.
It is directed that the judgment be modified to the extent indicated in this opinion.
As so modified, the judgment is affirmed.
All concur.
NOTES
[1]  Chapter 418 of the Kentucky Revised Statutes.
[2]  KRS 273.390.
[3]  The trusts discussed are in some instances inter vivos and in other instances testamentary.
[4]  Price v. A. D. Price Memorial Hospital, 288 Ky. 364, 156 S.W.2d 180.
[5]  KRS 273.291(2) (d) now specifically so provides.
[6]  Restatement of Trusts, Second, Sec. 401, Comment e, page 312.
[7]  Restatement of Trusts, Second, Sec. 391, p. 280.
[8]  KRS 418.075. See also 26 C.J.S. Declaratory Judgments § 122, pp. 281-283.
[9]  Orphan Society of Lexington v. Board of Education, Ky., 437 S.W.2d 194 illustrates application of Sec. 381 of Restatement of Trusts, Second, to a charitable trust containing a gift over with all proper parties before the court.
