fix mingw build failures in CI with clang-tidy. (cherry-picked from commit a8a72de6fbcf9afe8a6e8760f31a79a0ed6fed1a)