This recently happened to me, and luckily I was able to find a fix.
I was creating a virtual override function in a PlayerController header file and tried to use VS’s create declaration tool, but I believe since this function was an override it actually created a new and separate .cpp file for this class (which I am sure confused UE4). I found the file and deleted it, and the problem went away.
Seems to be more of a Visual Studio problem rather than UE4 bug. But I learned my lesson to be careful when using auto declarations. Hope that helps!