Donald Trump and Ted Cruz are locked in a battle in South Carolina to win over voters who want to see the border secured and fewer people here illegally. No matter whom they end up choosing, these voters will wind up disappointed. Both candidates’ plans would result in a dramatic surge in the number of unauthorized residents in the U.S.

Both Trump and Cruz have called for ending birthright citizenship as a way of curtailing illegal immigration. Here’s the problem: According to the Pew Research Center, 6.6 million Americans have been born to unauthorized immigrants since 1980, meaning that there would be that many more people here illegally had they been denied citizenship at birth.

Without birthright citizenship, the illegal population would have exploded past its current 11 million to at least 17 million. If some of the 6.6 million children of unauthorized immigrants also had children, it could be 20 million or more. Even if the change applies only in the future, this policy would add 3 million unauthorized residents over the next decade, given current birth rates.

The candidates are confused about the origins of the large unauthorized population and their “solutions” would make the problem worse. Both want massive increases in border enforcement. Sen. Cruz has called for tripling the border patrol, while Trump wants a border wall. But hardening the border would actually increase the number of people here illegally.

During the 1980s, nearly a million people illegally entered the United States from Mexico each year. But for every person who entered, another one went home, so the illegal population stayed roughly the same. Congress then intervened to stop this circular flow by steadily increasing the number of border agents 500 percent from 1990 to 2009. It backfired.

Just as many people entered illegally after the border buildup, but many fewer left. It was so difficult to cross the border that workers who made it past Border Patrol stayed and built their lives here. “If enforcement efforts had remained at pre-1986 levels,” concluded Princeton University’s Douglas Massey, “there would have been 5.3 million fewer net undocumented entries.”

Growth in the border patrol also led to a surge in births among unauthorized immigrants. After the post-1986 buildup, the likelihood of women entering illegally doubled. “As male migrants began to extend their trips to avoid the necessity of recrossing the border,” Massey observed, “they naturally began to send for their wives.”

If pregnant border crossers were behind the surge in births to unauthorized immigrants, as Trump claims, an increase in illegal crossings should mean an increase in births. However, crossings remained virtually constant in the 1980s, 1990s, and 2000s, yet there were tenfold fewer births in the 1980s before the border buildup. The boom in so-called “anchor babies” only came after increased border enforcement discouraged immigrants from returning to their original homes.

Trump’s plan has one decent feature that Cruz has rejected. The GOP frontrunner has stated that he would deport all immigrants here illegally but allow “the good ones” to return legally. This could incentivize some immigrants, possibly millions, to voluntarily sign up to be shipped out so they could come back legally. But Cruz has written off even this idea as “amnesty.”

Even worse, Cruz wants to cut legal immigration dramatically. He would admit immigrants under only the immediate relative or employment categories, cutting legal immigration by at least 25 percent. He also says he would oppose all other legal immigration increases.

A fact that both candidates blithely ignore is that illegal immigration has dropped dramatically in recent years, and legal immigration is the reason. Since 1995, the U.S. has granted permanent residency to 3.5 million Mexican immigrants, almost all through family-based categories. The rapid increase in this legal immigrant group corresponds to a 700 percent drop in Mexicans entering illegally.

In fact, the size of this legal Mexican population predicts 92 percentof Mexico’s illegal flow — as its size increases, the number coming illegally decreases. Legal immigration, combined with large increases in legal worker programs, has put the brakes on illegal immigration for the first time. America’s illegal population has actually shrunk by more than a million since 2007.

Trump and Cruz talk tough on illegal immigration, but their proposals are at odds with their stated goals. Simplistic anti-immigration rhetoric may have propelled them to the top of the polls, but once in office, the rhetoric will have to reckon with reality. They may want to start considering that reality sooner rather than later.

A version of this post originally appeared in The Washington Examiner.