I scoured the documentation but can’t find an easy way to make warnings get flagged as errors instead by the C++ compiler.
I got it to work by adding this to UE4Editor.target.cs and my own Editor target, but this seems fragile and a lot of work for such an obvious thing.
AdditionalCompilerArguments = "/WX";