Analysis in 2025
The Indexer still is not robust.
The Index is a per project file database, while it doesn't meet the basic database requirement to have a consistent persistent version at any time.
When such index file becomes corrupt, the Indexer function Rebuild in many cases is not able to simply throw away an inconsistent old version, start from zero and perform a consistent rebuild, as it should.
Known reasons for an index file to become corrupt are
Lack of Memory
Connection to a virtual drive with transient lease containing the workspace is lost
The Indexer does not report any of these.
Approaches
Delete related indexer files and rebuild the index.
Indexer files are
.metadata/.plugins/org.eclipse.cdt.core/<project>.<n>.pdom
inside the workspace folder.
If first approach does not succeed, the Indexer might be a memory problem.
The default memory settings in the eclipse configuration file eclipse.ini might be
-Xms256m
-Xmx2048m
You may increase both values by e.g. 100m and repeat approach 1. after restarting eclipse.
This is the summary from related question What do I do when the Eclipse CDT indexer gets stuck?.