diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
--- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -344,7 +344,7 @@
if (std::error_code EC = llvm::sys::fs::openFileForReadWrite(
ResultPath, FD, llvm::sys::fs::CD_CreateNew,
- llvm::sys::fs::OF_None)) {
+ llvm::sys::fs::OF_Text)) {
// Existence of the file corresponds to the situation where a different
// Clang instance has emitted a bug report with the same issue hash.
// This is an entirely normal situation that does not deserve a warning,