
894 So.2d 751 (2004)
Ex parte State of Alabama.
(In re J.L.N.
v.
STATE of Alabama).
1020651.
Supreme Court of Alabama.
June 4, 2004.
William H. Pryor, Jr., atty. gen., and J. Thomas Leverette and Cedric B. Colvin, asst. attys. gen., for petitioner.
Kyla Groff Kelim of Alec Brown & Associates, P.C., Alexander City, for respondent.
BROWN, Justice.
We granted the State's petition for a writ of certiorari to determine whether the Court of Criminal Appeals' decision that J.L.N. has standing to challenge the constitutionality of § 15-20-26(b), Ala.Code 1975, which prohibits an adult criminal sex offender from establishing a residence within 1000 feet of the victim's residence, conflicts with prior decisions both of this Court and of the Court of Criminal Appeals. Because we hold that the Court of *752 Criminal Appeals' decision conflicts with prior decisions both of this Court and of the Court of Criminal Appeals, we reverse and remand.

Facts and Procedural History
On April 10, 2000, J.L.N. was convicted of second-degree rape, or "statutory rape," a violation of § 13A-6-62(a)(1), Ala.Code 1975.[1] At the time of his arrest, J.L.N. was 28 years old and the victim, L.N.P., had just turned 15 years old. The trial court sentenced J.L.N. to 6 years' imprisonment but, pursuant to the Split Sentence Act, § 15-18-8, Ala.Code 1975, split the sentence, ordering J.L.N. to serve 90 days' imprisonment and to serve the remainder of the sentence on probation. J.L.N. filed no postjudgment motions. After his convictions, he was classified as an adult criminal sex offender under the Community Notification Act, § 15-20-20 et seq., Ala.Code 1975.
After J.L.N. was released from jail, but apparently while he was still on probation, L.N.P. and her mother moved into J.L.N.'s house.[2] J.L.N. was arrested and was charged with and convicted of violating § 15-20-26(b), Ala.Code 1975, a part of the Community Notification Act, because he, an adult criminal sex offender, established a residence or another living accommodation within 1,000 feet of the property on which the victim or any of her immediate family members resided.[3] J.L.N. entered a negotiated guilty plea and reserved his right to challenge the constitutionality of § 15-20-26(b), Ala.Code 1975.
J.L.N. appealed to the Court of Criminal Appeals, which reversed his conviction for violating § 15-20-26(b), holding that § 15-20-26(b) impinges on J.L.N.'s right to marry and is therefore unconstitutional. J.L.N. v. State, 894 So.2d 738 (Ala.Crim.App.2002). The State filed an application for rehearing which the Court of Criminal Appeals overruled on January 7, 2003. The State then filed a petition for a writ of certiorari with this Court. We granted the petition to determine whether, in light of prior decisions by this Court and the Court of Criminal Appeals, the Court of Criminal Appeals incorrectly determined that J.L.N. has standing to challenge the constitutionality of § 15-20-26(b), Ala.Code 1975.

Discussion
J.L.N. was convicted of violating § 15-20-26(b), Ala.Code 1975; that Code section provides:
"Unless otherwise exempted by law, no adult criminal sex offender shall establish a residence or any other living accommodation within 1,000 feet of the property on which any of his or her former victims, or the victims' immediate family members reside."
The Court of Criminal Appeals held § 15-20-26(b), Ala.Code 1975, unconstitutional *753 because, it reasoned, the statute interferes with J.L.N.'s right to marry. The court concluded that the statute impinged on J.L.N.'s right to marry because "the record suggests that [J.L.N.'s] desire to marry L.N.P. formed at least part of the reason for [J.L.N.'s] decision to violate [§ 15-20-26(b)]...." J.L.N. v. State, 894 So.2d at 746. The State, however, argues that J.L.N. does not have standing to make such an argument because J.L.N. and the victim are not married, nor have they attempted to marry and been thwarted in that attempt. The State further argues that J.L.N. does not have a constitutional right to cohabit with his underage statutory-rape victim outside of a marital relationship. The State contends that the Court of Criminal Appeals' decision in this case conflicts with well-established caselaw holding that one must have standing before a court obtains subject-matter jurisdiction over a claim. We agree.
"Not all controversies ... are justiciable. Justiciability is a compound concept, composed of a number of distinct elements. Chief among these elements is the requirement that a plaintiff have `standing to invoke the power of the court in his behalf.'" Ex parte State ex rel. James, 711 So.2d 952, 960 (Ala.1998) (quoting Ex parte Izundu, 568 So.2d 771, 772 (Ala.1990)). "Standing ... turns on `whether the party has been injured in fact and whether the injury is to a legally protected right.'" State v. Property at 2018 Rainbow Drive, 740 So.2d 1025, 1027 (Ala.1999)(quoting Romer v. Board of County Comm'rs of the County of Pueblo, 956 P.2d 566, 581 (Colo.1998)(Kourlis, J., dissenting)).
"When a party without standing purports to commence an action, the trial court acquires no subject-matter jurisdiction. Barshop v. Medina County Underground Water Conservation District, 925 S.W.2d 618, 626 (Tex.1996) (`Standing is a necessary component of subject matter jurisdiction'). See also Raines v. Byrd, 521 U.S. 811, 117 S.Ct. 2312, 138 L.Ed.2d 849 (1997); Lewis v. Casey, 518 U.S. 343, 116 S.Ct. 2174, 135 L.Ed.2d 606 (1996); United States v. Hays, 515 U.S. 737, 742, 115 S.Ct. 2431, 132 L.Ed.2d 635 (1995) ('"standing `is perhaps the most important of [the jurisdictional] doctrines'" '); National Organization for Women, Inc. v. Scheidler, 510 U.S. 249, 255, 114 S.Ct. 798, 127 L.Ed.2d 99 (1994) (`Standing represents a jurisdictional requirement which remains open to review at all stages of the litigation.'); Romer v. Board of County Comm'rs of the County of Pueblo, supra, 956 P.2d at 585 (`standing is a jurisdictional prerequisite to every case and may be raised at any stage of the proceedings') (Martinez, J., dissenting); Cotton v. Steele, 255 Neb. 892, 587 N.W.2d 693 (1999). But see Hertzberg v. Zoning Bd. of Adjustment of the City of Pittsburgh, 554 Pa. 249, 721 A.2d 43 (1998) (standing is not jurisdictional)."
State v. Property at 2018 Rainbow Drive, 740 So.2d at 1028.
In State v. Woodruff, 460 So.2d 325 (Ala.Crim.App.1984), the defendant, Woodruff, moved the trial court to dismiss the criminal complaint against him because, Woodruff alleged, the statute upon which the complaint was based  § 13A-6-65(a)(3), Ala.Code 1975, which prohibits deviate sexual intercourse between unmarried individuals  was unconstitutional. Specifically, Woodruff argued that the statute violated the right of privacy of consenting adults to engage in sexual intercourse. The trial court dismissed the complaint, apparently agreeing that the statute was unconstitutional.
The Court of Criminal Appeals, however, reviewing the trial court's judgment, *754 noted that Woodruff failed to demonstrate that he had standing to challenge the statute.
"Appellate courts will not pass upon a constitutional question unless some specific right of the appellant is directly involved; the appellant must belong to that class affected by the statute's provisions. McCord v. Stephens, 295 Ala. 162, 325 So.2d 155 (1975); Evans v. State, 338 So.2d 1033 (Ala.Crim.App.1976), cert. denied, 348 So.2d 784 (Ala.1977); Bozeman v. State, 7 Ala.App. 151, 61 So. 604, cert. denied, 183 Ala. 91, 63 So. 201 (1913). Even under the circumstances where a constitutional attack on a statute may be presented to the trial court prior to trial and, consequently, without benefit of a trial record, adherence to the traditional concepts of standing is required. See, e.g., State v. Friedkin, 244 Ala. 494, 14 So.2d 363 (1943); State v. Wilkerson, [54 Ala.App. 104, 325 So.2d 378 (1974)]; People v. Allen, 657 P.2d 447 (Colo.1983); State v. Raybon, 242 Ga. 858, 252 S.E.2d 417 (1979); State v. Price, 237 N.W.2d 813 (Iowa 1976), appeal dismissed, 426 U.S. 916, 96 S.Ct. 2619, 49 L.Ed.2d 370 (1976); People v. Jose L., 99 Misc.2d 922, 417 N.Y.S.2d 655 (N.Y.Crim.Ct.1979); Commonwealth v. Bonadio, 490 Pa. 91, 415 A.2d 47 (1980); Commonwealth v. Hughes, 468 Pa. 502, 364 A.2d 306 (1976). Unless these usual rules of standing are not applicable to the situation at bar, they should have precluded the trial court from deciding the constitutionality of the sexual misconduct statute in a factual vacuum."
State v. Woodruff, 460 So.2d at 328.
The Court of Criminal Appeals in Woodruff noted that the trial court made its decision after a brief oral argument on the issue of the constitutionality of the statute and that the transcript was totally devoid of any evidence indicating that Woodruff's right to privacy had been violated. Furthermore, the complaint charging Woodruff offered no indication of the factual setting in which the alleged violation of the statute occurred. The Court of Criminal Appeals held that because Woodruff failed to demonstrate that he suffered an injury to a legally protected right the trial court did not obtain subject-matter jurisdiction over his claim that § 13A-6-65(a)(3), Ala.Code 1975, was unconstitutional, and the Court of Criminal Appeals remanded the case for further proceedings.
In this case, J.L.N. challenges the constitutionality of § 15-20-26(b), Ala.Code 1975, on the basis that it impinges on his right to marry. The Court of Criminal Appeals' opinion notes that L.N.P., the victim, purportedly stated in an unverified witness-statement form transcribed by a police officer, that she and J.L.N. were "engaged." However, as the Court of Criminal Appeals plainly acknowledges in its opinion, J.L.N. and the victim are not married and they have not attempted to marry. J.L.N., 894 So.2d at 740. Instead, J.L.N. was arrested and convicted of cohabiting with the minor victim in violation of § 15-20-26(b), Ala.Code 1975. J.L.N. does not have a constitutional right merely to cohabit with his minor statutory-rape victim in this case.[4] Thus, J.L.N. has not demonstrated what, if any, legally protected right of his has actually been violated. At most, J.L.N. alleges that, if in the future he should attempt to marry L.N.P., § 15-20-26(b), Ala.Code 1975, would violate his constitutional right to marry. This allegation is insufficient to demonstrate *755 that J.L.N. has actually suffered an injury and that that injury was to a constitutionally protected right.[5] Although there may be parties whose constitutional rights may be harmed by § 15-20-26(b), Ala.Code 1975, J.L.N. has failed to demonstrate that he is such a party. Therefore, he lacks standing to challenge the constitutionality of that statute.

Conclusion
The Court of Criminal Appeals erroneously held that J.L.N. had standing to challenge § 15-20-26(b), Ala.Code 1975, as impinging his right to marry when that court acknowledged that J.L.N. had never made any attempt to marry the victim and was merely cohabiting with her in violation of the statute. Therefore, the judgment of the Court of Criminal Appeals is reversed and the case remanded for proceedings consistent with this opinion.
REVERSED AND REMANDED.[*]
HOUSTON, SEE, LYONS, JOHNSTONE, HARWOOD, WOODALL, and STUART, JJ., concur.
NOTES
[1]  Section 13A-6-62(a)(1), Ala.Code 1975, provides, in pertinent part:

"(a) A person commits the crime of rape in the second degree if:
"(1) Being 16 years old or older, he or she engages in sexual intercourse with a member of the opposite sex less than 16 and more than 12 years old; provided, however, the actor is at least two years older than the member of the opposite sex."
[2]  According to an unverified witness-statement form contained in the record purporting to be a statement by the victim, the mother was apparently unable to pay her bills when she and L.N.P. moved in with J.L.N. The mother had signed the warrants against J.L.N. that had resulted in his previous arrest and conviction for statutory rape.
[3]  According to the State's petition, after the victim and her mother moved into J.L.N.'s house, the victim's mother was charged with endangering the welfare of a child, in violation of § 13A-13-6, Ala.Code 1975.
[4]  J.L.N. does not allege, nor does he cite any legal authority for the proposition, that he has a constitutional right to cohabit, outside of marriage, with his minor statutory-rape victim.
[5]  The Court of Criminal Appeals hypothesizes in its opinion that if, in the future, J.L.N. should attempt to marry the victim, he may violate other provisions of § 15-20-26, Ala.Code 1975. However, in this case, J.L.N. was charged with and convicted of violating only § 15-20-26(b), Ala.Code 1975. Thus, while it may be an interesting academic exercise to anticipate other issues that could arise as a result of enforcing § 15-20-26, Ala.Code 1975, no other provisions of that statute are before us.
[*]  Note from the reporter of decisions: On August 13, 2004, on remand from the Alabama Supreme Court, the Court of Criminal Appeals affirmed, by unpublished memorandum.
