Warren Buffett says he would shy away from making long-term investments in states that have rung up huge public pension liabilities, because sooner or later taxes will have to go up.

"If I were relocating into some state that had a huge unfunded pension plan I'm walking into liabilities," Buffett told CNBC's Becky Quick earlier this week. "I say to myself, 'Why do I wanna build a plant there that has to sit there for 30 or 40 years?' Because I'll be here for the life of the pension plan, and they will come after corporations, they'll come after individuals. They just—they're gonna have to raise a lotta money."

Buffett's remarks paint a candid picture of how investors and corporations see the slowly unfolding pension crisis that threatens to swamp many states' budgets for years to come. Unfunded pension debt across the 50 states totals a staggering $1.6 trillion, even by the plans' own (often overly rosy) accounting. But the obligations vary widely from state to state.

As Buffett suggests, that means states that have kept their pension systems relatively healthy have a competitive edge when trying to land large corporate investments like the new Amazon HQ2. Just as a state with lower tax rates might have an edge in attracting businesses, states with high pension debt will drive them away—because investors correctly see those unfunded liabilities as future tax rates.

Here's the rest of Buffett's response when asked about how public pension obligations would factor into his own investment strategies:

In the public sector, you know, it's a disaster. And, you know, some of the—it's interesting to me when they talk about these relocation problems, you know, and New York and Amazon, all that sort of thing, you know—I—if I were relocating into some state that had a huge unfunded pension plan I'm walking into liabilities. 'Cause I mean, who knows whether they're gonna get it from the corporate income tax or my employees—you know, with personal income taxes or what. But that—that liability isn't gonna—you can't ship it offshore or anything like that. And those are big numbers, really big numbers. And they may come—you can delay a long time. I mean, they—you're getting pushed maybe somewhat. But the politicians are the ones that really haven't attacked it in a good many states. And when you see what they would have to do—I say to myself, "Why do I wanna build a plant there that has to sit there for 30 or 40 years?" Beause I'll be here for the life of the pension plan—and they will come after corporations, they'll come after individuals. They just—they're gonna have to raise a lotta money.

Some states are already chasing pension revenue in increasingly convoluted ways. Illinois, which faces one of the nation's most significant pension problems, is considering a tax on private retirement savings to fund public pension obligations. New Jersey, another state that's deep in the red, is planning to use higher or new taxes on hotel rooms, e-cigarettes, marijuana, and ride-sharing to fund its pension debt.

Those measures are unlikely to be enough. Taxpayer contributions to public pension plans have increased dramatically since the Great Recession, yet "only 27 states contributed enough in 2016 to expect their funding gaps to decline if actuarial assumptions were met," according to a report the Pew Charitable Trusts released last year. Broader tax increases are likely to be needed, particularly in states where cutting pension payments to current and retired workers is forbidden by law.

Another economic downturn would make a bad situation much worse. A recent report by three researchers at the Harvard Kennedy School found that "public pension systems may be more vulnerable to an economic downturn than they have ever been." After subjecting state pension plans to a series of stress tests meant to simulate the consequences of a variety of adverse economic climates over the next two decades—including everything from another major recession to merely lower-than-expected investment growth—Greg Mennis, Susan Banta, and David Draine concluded that deeply indebted pension plans in places such as Kentucky and New Jersey face insolvency even if annual returns average 5 percent for the forseeable future.

Buffett's comments to CNBC make clear that it won't take another recession to keep major investments out of states already struggling with high levels of pension debt. States will have to raise "a lotta money"—and every dollar of it will be coming out of someone's pocket.