Bogus syntax errors due to wrong framework

I have a project with targets that use different versions of a private framework. When I do a build, all seems well. The problem is when the Xcode 11.4 IDE does its quick compile to find syntax errors in the source file being edited. (I'm sure there's some technical term for that, which I've forgotten.) In a certain C++ source, I'm getting incorrect syntax errors, apparently due to the wrong version of the private framework being used. I've double-checked that the framework search paths are correct in each target, and I'm linking to the right thing in each target. I've tried nuking derived data and build data folders to no avail. Any suggestions?

Bogus syntax errors due to wrong framework
 
 
Q