We know the answer to this because of Japan - here's a report in New Geography:
Japan’s working-age population (15-64) peaked in 1995, while the United States’ has grown 21% since then. The projections for Japan are alarming: its working-age population will drop from 79 million today to less than 52 million in 2050, according to the Stanford Institute on Longevity.
Since hitting a peak of 128 million in 2010, Japan’s overall population has dropped three years in a row. These trends all but guarantee the long-term decline of the Japanese economy and its society.
Bear in mind that Japan's population is 127 million today - it will fall but the precise figures are hard to predict because of longevity. The New Geography article sets out some of the consequences:
...by 2020, adult diapers are projected to outsell the infant kind. By 2040, the country will have more people over 80 than under 15, according to U.N. projections. By 2060, the number of Japanese is expected to fall from 127 million today to about 87 million, of whom almost 40% will be 65 or older.
Put simply Japan can't afford to do this. It can barely afford the cost of health and care today. And this is the reason why Japan's economy is struggling. Moreover, it points to the reason why the UK, Germany and the USA stand an outside chance of affording health and social care costs at least for the time being. We have had relatively open borders allowing us to maintain the size of our working age populations - without this immigration we would be facing the same time bomb as Japan faces.
It's not just a fiscal time bomb it's a social one too:
Japan’s grim demography is also leading to tragic ends for some elderly. With fewer children to take care of elderly parents, there has been a rising incidence of what the Japanese call kodokushi, or “lonely deaths” among the aged, unmarried, and childless. Given the current trends, this can only become more commonplace over time.