
400 So.2d 402 (1981)
BOARD OF TRUSTEES OF the POLICEMEN'S AND FIREMEN'S RETIREMENT FUND
v.
Shirley Patrick CARDWELL, etc.
80-248.
Supreme Court of Alabama.
June 19, 1981.
*404 Roger W. Kirby, Gadsden, for appellant.
James E. Hedgspeth of Floyd, Keener & Cusimano, Gadsden, for appellee.
BEATTY, Justice.
The Board of Trustees of the Policemen's and Firemen's Retirement Fund of the City of Gadsden appeals from a determination that § 17 of Act No. 904 of the 1975 Acts of Alabama was unconstitutional. We reverse and remand.
The defendant, Shirley Patrick Cardwell, married Michael Patrick on June 30, 1966. Two children were born to themStacy in 1967 and Scott in 1970. Michael was employed by the City of Gadsden as a firefighter. On August 31, 1976, Michael was killed in the line and scope of his employment.
From September 13, 1976 until June 1977, Mrs. Cardwell (then Mrs. Patrick) received $188.94 per month in benefits from the Board of Trustees of the Policemen's and Firemen's Retirement Fund of the City of Gadsden (hereinafter the Board).
On July 14, 1977 Mrs. Patrick remarried. No benefits were paid to Mrs. Cardwell or to the two Patrick children after her remarriage.
A dispute arose between Mrs. Cardwell and the Board as to whether the minor children should continue to receive benefits after the remarriage of the mother. The Board then filed a declaratory judgment action asking the trial court to determine whether certain pension benefits should be paid to the children. The children were named as defendants and guardians ad litem were appointed for each of them. The parties agreed to a stipulation of the facts. The plaintiff filed supporting affidavits and moved for summary judgment. The defendants opposed the motion. On June 9, 1980 the trial court denied the plaintiff's summary judgment motion and entered an order holding that the minor children were entitled to receive the pension benefits. After the Board's motion for a new trial or alternatively to set aside the judgment was denied, the Board appealed.
Although neither party raises this question, nevertheless the trial court's order appears in an uncertain posture. The motion for summary judgment was filed by the plaintiff, but it was denied and judgment was then rendered for the defendants, even though the defendants filed no motion. While that action does not comport with Rule 12, ARCP, on judgment on the pleadings, that is the effect of the trial court's action.
The ultimate issue presented by this appeal is whether § 17 of Act 904 of the 1975 Acts of Alabama violates the equal protection clause of the Fourteenth Amendment by denying benefits to minor children of a deceased firefighter when the mother remarries, while allowing minors in other classifications to receive benefits.
Section 17 reads as follows:
If any active member of such police or fire department ... shall die from any cause whatever, leaving a widow or widower, said board shall direct the payment from said fund, to said widow or widower, of a sum equal to fifty percent of the amount specified in this act to be paid to a retired fireman or policeman of the same rank as such deceased member at the time of his or her death, said monthly payments to continue to such widow or widower during his or her natural life and while unmarried. Should such deceased member leave no surviving widow or widower, but leave surviving him or her a child or children under eighteen years of age, the board of trustees shall direct the payment monthly from such fund, until such child or children shall have attained the age of eighteen years, of a sum equal to fifty percent of the amount specified in this act to be paid to a retired fireman or policeman of the same rank as such deceased member at the time or his or her death, to the person having control and custody of such child or children or to such other person as the *405 board of trustees shall direct, said sum to be expended by such person for the benefit of such child or children as may be prescribed by the board of trustees.
The trial court in concluding that § 17 violated the equal protection clause of the Fourteenth Amendment made the following specific findings of fact:
. . . .
(16) That minor children have a fundamental right to be supported and maintained.
. . . .
(18) That the Defendants are being denied this fundamental right to support by the actions of the Plaintiff in ceasing benefits upon their mother's remarriage.
(19) That Plaintiff has presented no evidence or cited any law to the Court showing that such deprivation promotes a compelling governmental interest under the Roe case, supra, [410 U.S. 113, 93 S.Ct. 705, 35 L.Ed.2d 147 (1973)] or that such is rationally related to some governmental interest under the San Antonio School District case, supra, [411 U.S. 1, 93 S.Ct. 1278, 36 L.Ed.2d 16 (1973)] and by virtue of the Plaintiff having failed to present such to the Court, it has not carried the burden of satisfying such tests.
The appellant urges the trial court erred in applying the proper standards used in reviewing statutes which are alleged to violate the equal protection clause of the Fourteenth Amendment.
There are two standards for reviewing statutes alleged to violate equal protection: 1. the compelling interest test; and 2. the rational basis test. The compelling interest test requires that where a classification infringes upon a fundamental right or constitutes a suspect class, a compelling interest must be shown to uphold the statute. See San Antonio School District v. Rodriguez, 411 U.S. 1, 93 S.Ct. 1278, 36 L.Ed.2d 16 (1973); Roe v. Wade, 410 U.S. 113, 93 S.Ct. 705, 35 L.Ed.2d 147 (1973). Where neither a fundamental right nor a suspect class is involved, the rational basis test applies. It requires only that a classification of persons similarly situated be rationally related to a legitimate legislative purpose. San Antonio School District v. Rodriguez, 411 U.S. 1, 93 S.Ct. 1278, 36 L.Ed.2d 16 (1973); Muncaster v. Alabama State Ethics Commission, Ala., 372 So.2d 853 (1979).
While it is not clear which test the trial court used in this case, it appears that the compelling interest test was used because of the specific findings that the children had a "fundamental right to be supported and maintained," that they were being denied this right by the actions of the plaintiff "in ceasing benefits upon their mother's remarriage" and that the plaintiff failed to show any compelling governmental interest.
We cannot agree that these children had a fundamental right to be supported by a public pension plan. While we recognize that a father has a legal and moral duty to support his minor children and if he is unable to provide it, the mother can be compelled to contribute to their support, Collier v. Collier, 57 Ala.App. 208, 326 So.2d 769 (1976), that duty has never been applied to a governmental pension fund. The right to a pension is purely statutory. Cox v. Dunn, 243 Ala. 176, 9 So.2d 1 (1942). In Smith v. King, 277 F.Supp. 31 (M.D.Ala. 1967) aff'd 392 U.S. 309, 88 S.Ct. 2128, 20 L.Ed.2d 1118 (1968), the court stated:
It should be noted that there is no vested legal right for anyone to receive public financial assistance; neither the United States nor the Alabama Constitution requires Alabama to grant financial assistance to needy dependent children....
Thus we find that the trial court erred in holding that these children had a fundamental right to support by a governmental pension plan.
Although the trial court did not make a specific finding on the existence vel non of a suspect category, the defendants urge that by allowing some children to receive benefits, but not all, a suspect category was created. A suspect category, however, requires more than merely receiving different treatment. In San Antonio *406 School District v. Rodriguez, supra, the United States Supreme Court stated that a suspect category is a class "... saddled with such disabilities, or subject to such a history of purposeful unequal treatment, or relegated to such a position of political powerlessness as to command extraordinary protection from the majoritarian political process." It is clear that the class represented by these children does not rise to the status of a suspect category. Since neither a fundamental right nor a suspect category is involved here, the next step in an equal protection analysis is to determine whether this statute could meet the requirements of the rational basis test.
Under the rational basis test a statute must only have a rational relation to a legitimate governmental interest to be valid. San Antonio School District v. Rodriguez, supra; Muncaster v. Alabama State Ethics Commission, supra. The purpose of terminating benefits to the surviving spouse and children on the remarriage of the surviving spouse is to limit the number of individuals who receive benefits and the period of coverage in order to aid the pension system financially. A state legislature has a rational purpose and legitimate interest when it attempts to prevent a pension system from being unduly burdened. Freeman v. New York City Dept. of Corrections, 101 Misc.2d 22, 420 N.Y.S.2d 536 (1979). Thus we find that § 17 of Act No. 904 of the 1975 Acts of Alabama passes the rational basis test as it is rationally related to a legitimate state interest.
Although the trial court's order which would allow the pension benefits to continue to be paid to these children throughout most of their minority has a certain appeal, that order supplies a requirement which the legislature did not include. As we stated earlier, the right to a pension is purely statutory, Cox v. Dunn, supra. For that reason the courts of this state do not have the power to grant benefits to classes of people not included by the legislature, but merely to determine whether it was constitutional for the legislature to exclude them. Since we have determined that the section in question was constitutional, the order of the trial court which found that section to be unconstitutional must be, and is hereby, reversed and remanded.
REVERSED AND REMANDED.
TORBERT, C. J., and MADDOX, JONES and SHORES, JJ., concur.
