As a workaround, I deleted the Include Directories field set up in the generated solution file, as described here: Unreal Engine 4.25 source code compile error
This fixes the build, but has the unfortunate side effect that Intellisense suddenly doesn’t know where to look for any engine includes, so it starts flagging all your code with red squigglies.