In a new branch, I created a new class and committed the file to the branch. I then switched back to my master branch and the new class filename turned red. I also received a compiler warning:
...clang failed with exit code 1
Did you add the file to your master branch? I'm betting no given all the symptoms...
But sometimes new changes survive branch changes, so the project file still references them.