
539 N.W.2d 339 (1995)
STATE of Iowa, Appellee,
v.
Tyrone Eugene HALLIBURTON, Appellant.
No. 94-388.
Supreme Court of Iowa.
October 25, 1995.
Rehearing Denied November 17, 1995.
*340 Linda Del Gallo, State Appellate Defender, and Ahmet S. Gonlubol, Assistant State Appellate Defender, for appellant.
Thomas J. Miller, Attorney General, Ann E. Brenden and Susan M. Crawford, Assistant Attorneys General, Paul L. Martin, County Attorney, and Mary Ellen Reimund, Assistant County Attorney, for appellee.
Considered by McGIVERIN, C.J., and LAVORATO, NEUMAN, ANDREASEN, and TERNUS, JJ.
TERNUS, Justice.
Tyrone Eugene Halliburton (Halliburton) appeals his convictions and sentences for possession of an offensive weapon and possession of an offensive weapon by a felon. See Iowa Code §§ 724.3, 724.26 (1993). He presents two claims on appeal: (1) evidence obtained in four searches of his mother's car should have been suppressed because the searches violated the Fourth Amendment of the United States Constitution and article I, section 8 of the Iowa Constitution; and (2) his convictions and sentences for both crimes violated the Double Jeopardy Clause of the Fifth Amendment of the United States Constitution and Iowa Code section 701.9. We conclude that Halliburton failed to preserve error on his challenge to two of the searches and on his double jeopardy claim. We also *341 hold that Halliburton had no legitimate expectation of privacy in his mother's car and thus cannot challenge the constitutionality of the two searches on which error was preserved. Finally, we conclude that the merger requirement of section 701.9 does not apply. Therefore, we affirm.

I. Background Facts and Proceedings.

On July 25, 1993, Halliburton and his brother, Denniss, were traveling on Interstate 35 in a car owned and driven by their mother, Helen Halliburton. Just before midnight, the car struck a deer, causing Halliburton's mother to pull off the road. Shortly after she had parked the vehicle on the side of the road, a state trooper stopped and gave the Halliburtons a ride to a nearby restaurant.
The next morning, Iowa State Patrol Lieutenant Fellin noticed the Halliburton car while on patrol. About an hour later, Fellin stopped when he noticed that the car was still parked on the roadside and had not been tagged.[1] He ran a license check on the car and learned it was registered to Helen Halliburton, but the registration had expired. Fellin then decided to look inside the unlocked car for any papers that might reveal who owned or used the car. Inside Fellin saw a packet of cigarette papers and forceps. Fellin then tagged the car and continued his patrol.
After Fellin drove away, Halliburton and his brother walked back to the car. The car started and Halliburton's brother drove it back to the restaurant. Later that morning Fellin noticed the car at the restaurant and pulled in to investigate the expired registration. As Fellin approached, he observed Halliburton's brother close the trunk.
While Fellin was talking to Helen Halliburton about the expired registration he noticed a black leather jacket inside the car. Fellin searched the jacket out of concern for his safety; he was the sole officer on the scene. Inside the jacket Fellin discovered a pager, a box knife with a retractable razor blade, and a small pocket knife. In addition, Fellin saw a gang-affiliated tattoo on Halliburton's arm.
Iowa State Patrol Trooper Kunert then arrived on the scene. After being briefed by Fellin, Kunert spoke with Halliburton's brother. During this conversation, Kunert noticed the odor of marijuana on the brother's breath. As a result, Kunert searched the passenger area of the Halliburton car. Inside Kunert found forceps, cigarette papers, and three marijuana butts.
After Kunert told Fellin what he had found, Fellin asked to search the trunk. By then either Halliburton's mother or brother had given the car keys to Halliburton. Fellin took the keys from Halliburton's hand and searched the trunk. Inside the trunk Fellin found a sawed-off shotgun. Halliburton said he owned the gun and intended to sell it.
The officers arrested Halliburton. He was subsequently charged with possession of an offensive weapon as a habitual offender and felon in possession of an offensive weapon as a habitual offender. The district court denied Halliburton's motion to suppress all evidence seized during the search of the car while it was parked on the interstate and during the search of the trunk.
Before trial, the parties reached an agreement to submit the case on the minutes of testimony. Halliburton agreed to waive his right to a jury trial and the State agreed to drop the habitual offender allegation. At trial Halliburton stated his belief that the court would find him guilty of both charges and sentence him to consecutive prison terms of up to five years each. Following the stipulated bench trial, the court found Halliburton guilty of possession of an offensive weapon and possession of an offensive weapon by a felon. The court sentenced him to two consecutive indeterminate terms not to exceed five years each. Halliburton appeals.

II. Scope of Review.

Our review of constitutional challenges is de novo. State v. Finnel, 515 N.W.2d 41, 43 (Iowa 1994). We review Halliburton's *342 statutory claim for errors of law. Id.; Iowa R.App.P. 4.

III. Constitutionality of Searches.

A. Preservation of error. On appeal, Halliburton claims that the search of the car on the interstate, the search of the jacket, the search of the passenger compartment of the car at the restaurant and the search of the trunk were unreasonable searches that violated the Iowa Constitution and the Fourth Amendment of the United States Constitution. The State initially contends that Halliburton did not preserve error with respect to the search of his jacket and the search of the passenger compartment of the vehicle while it was parked at the restaurant.
In Halliburton's motion to suppress and a later amendment to that motion, he claimed that the sawed-off shotgun should be suppressed because "the initial search of the vehicle while parked along the interstate and the search of the vehicle's trunk are unreasonable and unlawful." He did not challenge the legality of the search of the jacket, nor Kunert's search of the passenger area of the car. In his appellate reply brief, Halliburton claims that he challenged the search of the jacket in his brief in support of the motion to suppress. However, the record does not show such a challenge. Moreover, the trial court's ruling on the motion to suppress addresses only the search on the interstate and the search of the trunk.
When a party fails to alert the district court to its contentions, that party cannot thereafter rely on those contentions to seek a reversal on appeal. State v. Rosenstiel, 473 N.W.2d 59, 61 (Iowa 1991). Because Halliburton failed to challenge the constitutionality of the search of his jacket and the search of the passenger compartment in the restaurant parking lot, we do not consider those issues.
B. Did the challenged searches violate Halliburton's constitutional rights? In deciding the constitutionality of a search under the Fourth Amendment, we take a two-step approach. First, the defendant must show that he had a legitimate expectation of privacy in the area searched. United States v. Salvucci, 448 U.S. 83, 92, 95, 100 S.Ct. 2547, 2553, 2554, 65 L.Ed.2d 619, 628, 630 (1980) (defendants, although in possession of goods seized in search, had to establish a legitimate expectation of privacy in the areas of their mother's home where the goods were found); Rakas v. Illinois, 439 U.S. 128, 143, 99 S.Ct. 421, 430, 58 L.Ed.2d 387, 401 (1978) (citing Katz v. United States, 389 U.S. 347, 353, 88 S.Ct. 507, 512, 19 L.Ed.2d 576, 583 (1967)); State v. Becker, 458 N.W.2d 604, 608 (Iowa 1990). Second, if the defendant had a legitimate expectation of privacy, we must then decide whether the State unreasonably invaded the protected interest. Becker, 458 N.W.2d at 608. We conclude that Halliburton did not have a legitimate expectation of privacy in his mother's automobile. Therefore, we do not reach Halliburton's arguments concerning the reasonableness of the searches.
The United States Supreme Court's decision in Rakas effectively disposes of any contention that Halliburton had a legitimate expectation of privacy in his mother's vehicle. In Rakas, the defendants were passengers in a car which neither of them owned. Rakas, 439 U.S. at 129, 99 S.Ct. at 423, 58 L.Ed.2d at 392. A search of the car revealed a sawed-off rifle and shells which were admitted into evidence over the defendants' motion to suppress. Id. Because the defendants were merely passengers in the car, the court held that they failed to show a legitimate expectation of privacy in the areas searched. Id. at 150, 99 S.Ct. at 434, 58 L.Ed.2d at 405. Thus, the defendants could not rely on the Fourth Amendment to suppress the evidence discovered during the search. Id. Similarly, the Iowa Court of Appeals has held that a passenger in a motor vehicle cannot successfully challenge the search of a vehicle in which he had merely been a passenger. State v. Hungerford, 311 N.W.2d 699, 700 (Iowa Ct.App.1981).
We apply these principles here. Halliburton was merely a recent passenger in his mother's vehicle. He was not the driver of the vehicle when it was parked on the interstate and he did not drive it to the restaurant. Although Halliburton possessed the keys to the car at the time of the final *343 search, there is no evidence that he was in control of the vehicle, or otherwise possessed it at that time. To the contrary, he never asserted a right to control access to the vehicle during any of the searches. Additionally, his mother, the owner of the vehicle, was always present except for a brief trip to the restroom.
Under these circumstances, we conclude Halliburton did not have a legitimate expectation of privacy protected by the Fourth Amendment. See Flores v. State, 871 S.W.2d 714, 720 (Tex.Crim.App.1993) (en banc), cert. denied, ___ U.S. ___, 115 S.Ct. 313, 130 L.Ed.2d 276 (1994) (defendant had no legitimate expectation of privacy in his mother's automobile in absence of evidence that he had an interest in or right to use the car). For the same reason, Halliburton may not successfully rely on the Iowa Constitution's protection against unreasonable searches and seizures. See State v. Showalter, 427 N.W.2d 166, 168 (Iowa 1988) (we interpret article I, section 8 of the Iowa Constitution consistently with the federal interpretations of the Fourth Amendment). Therefore, the trial court correctly overruled Halliburton's motion to suppress the evidence found in the search of the passenger area and trunk of his mother's car.

IV. Challenge to Sentences.

Halliburton also contends that the crime of possession of an offensive weapon is a lesser included offense of possession of an offensive weapon by a felon. Therefore, he argues, the trial court should have merged his sentences for these crimes. Halliburton claims that the court's failure to do so violates the Double Jeopardy Clause of the Fifth Amendment and Iowa Code section 701.9.
The State's response is threefold. First, it contends that Halliburton cannot challenge his sentences on appeal because he failed to object in the trial court and he agreed to the imposition of sentences for both offenses in return for the State's dismissal of the habitual offender allegation. Second, the State argues that the crime of possession of an offensive weapon is not a lesser included offense of possession of an offensive weapon by a felon. Third, the State asserts that even if these offenses meet the test for lesser included offenses, the legislature intended to impose separate and cumulative punishments.
A. Error preservation. As a rule, a defendant must preserve error by making an objection at the earliest opportunity after the grounds for the objection become apparent. State v. Johnson, 476 N.W.2d 330, 333 (Iowa 1991). This rule applies equally to constitutional issues. Id.; Patchette v. State, 374 N.W.2d 397, 401 (Iowa 1985).
Halliburton could have raised the issues now before us in the district court. See State v. Allen, 304 N.W.2d 203, 208 (Iowa 1981). Halliburton knew before trial if he were found guilty, the State would recommend consecutive sentences; this was part of the agreement made when the State dropped the habitual offender allegation. At the sentencing hearing, the county attorney requested the imposition of consecutive sentences. Halliburton's attorney did not object. To the contrary, he joined in the State's request "to comply with the plea agreement." Because Halliburton failed to object to his conviction and sentencing on both counts in the trial court, we will not consider his claim of double jeopardy for the first time on appeal. State v. Burgs, 479 N.W.2d 323, 323 n. 1 (Iowa 1992); see State v. Peck, 539 N.W.2d 170 (Iowa 1995) (double jeopardy claim may be waived); Patchette, 374 N.W.2d at 401 (due process claim raised for the first time on appeal will not be addressed).
Nevertheless, illegal sentences are not subject to the usual requirements of error preservation and waiver. State v. Garrett, 516 N.W.2d 892, 894 (Iowa 1994); State v. Ohnmacht, 342 N.W.2d 838, 843 (Iowa 1983). An illegal sentence is one not authorized by statute; it is void. State v. Kapell, 510 N.W.2d 878, 879 (Iowa 1994). Therefore, Halliburton's conduct in the trial court does not prevent him from claiming on appeal that his sentences violated section 701.9.
B. Merger of sentences. Iowa Code section 701.9 requires the merger of lesser included offenses:
No person shall be convicted of a public offense which is necessarily included in *344 another public offense of which the person is convicted. If the jury returns a verdict of guilty of more than one offense and such verdict conflicts with this section, the court shall enter judgment of guilty of the greater of the offenses only.
This statute codifies the double jeopardy protection against cumulative punishments. State v. Gallup, 500 N.W.2d 437, 445 (Iowa 1993). If the Double Jeopardy Clause is not violated because the legislature intended double punishment, section 701.9 is not applicable and merger is not required. Finnel, 515 N.W.2d at 44; Gallup, 500 N.W.2d at 445.
The Double Jeopardy Clause prohibits multiple punishments for the same offense. Garrett v. United States, 471 U.S. 773, 777-78, 105 S.Ct. 2407, 2410-11, 85 L.Ed.2d 764, 770-71 (1985). In this sense, it prevents a court from imposing a greater punishment than the legislature intended. Id. at 793, 105 S.Ct. at 2418-19, 85 L.Ed.2d at 780. Therefore, in deciding whether a punishment is constitutionally permissible under the Double Jeopardy Clause, we look to what punishment the legislature intended to impose. Finnel, 515 N.W.2d at 43.
In detecting legislative intent, we first decide whether the crimes meet the legal elements test for lesser included offenses. Id. If they do, we then study whether the legislature intended multiple punishments for both offenses. State v. Lewis, 514 N.W.2d 63, 69 (Iowa 1994).
To apply the legal elements test for lesser included offenses, we compare the elements of the two offenses to determine whether it is possible to commit the greater offense without also committing the lesser offense. Id. We conclude that possession of an offensive weapon is a lesser included offense of possession of an offensive weapon by a felon under this test.
The elements of possession of an offensive weapon are (1) knowing possession (2) of an offensive weapon (3) by any person, other than an authorized person. Iowa Code § 724.3 (1993). In identifying the elements of the crime of possession of an offensive weapon by a felon, we look to the alternative of the crime charged. State v. Aguiar-Corona, 508 N.W.2d 698, 702 (Iowa 1993). Section 724.26 prohibits the possession, receipt or transportation of a firearm or offensive weapon. The alternative charged here and of which Halliburton was convicted was possession of an offensive weapon. The elements of this alternative are identical to the elements of possession of an offensive weapon with the exception that the State must also prove that the unauthorized person in possession of the offensive weapon is a felon. Iowa Code § 724.26 (1993). Thus, it is impossible to commit the greater offensepossession of an offensive weapon by a felon without also committing the lesser offense possession of an offensive weapon. Consequently, the two offenses of which Halliburton was convicted are the "same" for purposes of double jeopardy analysis.
We must now consider whether the legislature intended multiple punishments for both crimes: we conclude it did. Both offenses are class D felonies. If the legislature did not intend cumulative punishments, the offenses would always merge and the resulting sentence for the greater crime would be no more than the punishment for the lesser crime. As a consequence, there would be no reason for the State to charge a defendant with possession of an offensive weapon by a felon because a conviction of that charge would not enhance the defendant's sentence.
When the legislature adopts a law, we presume it intended that the entire statute be effective. Lewis, 514 N.W.2d at 69. Only by imposing cumulative punishments can we give effect to the possession alternative of section 724.26. Cf. id. (same factor showed legislature's intent to impose multiple punishments for criminal gang participation and for any "criminal acts" used as the underlying offense for that crime).
Further evidence of the legislature's intent is found in the differing purposes of these statutes. Although section 724.3 applies to any unauthorized person, it only prohibits the possession of "offensive weapons." The term "offensive weapons" is defined to include particularly lethal weapons such as machine guns and hand grenades. Iowa Code *345 § 724.1 (1993). In contrast, section 724.26 is directed toward potentially harmful personsfelons. They are prohibited from possessing not only offensive weapons, but also firearms. Id. § 724.26. Thus, these sections focus on different dangers; section 724.3 is aimed at a class of particularly harmful weapons, whereas section 724.26 is aimed at a group of potentially harmful persons.
We think the legislature intended that a defendant who violates section 724.3 and section 724.26 be punished under both statutes. Consequently, Halliburton was not subjected to double jeopardy and the merger requirement of section 701.9 does not apply. Therefore, the trial court's imposition of consecutive sentences was legal.
AFFIRMED.
NOTES
[1]  The lieutenant testified that cars are tagged so that other officers will know that someone has already checked on the vehicle and to document the length of time the vehicle is left unattended on the side of the road.
