On further investigation it seems like DequeTest.cpp is compiled many times (WHY?? No wonder Unreal takes so long to build!) but only on ONE occasion (building LowLevelTests) CHECK is not defined. The #if logic in TestHarness.h has a loophole in it such that the various testing macros are not defined.
I have just excluded the LowLevelTest build from the Configuration Manager. I will rely on it actually passing upstream. It seems to have been fixed in a Github commit
The ChaosUserDataPT.h has been also fixed on the 5.2 branch, GitHub commit - the solution was just to rename Solver → SolverBase.