diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp --- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp +++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp @@ -107,6 +107,8 @@ Compiler.getDiagnosticOpts().ShowCarets = false; // Don't write out diagnostic file. Compiler.getDiagnosticOpts().DiagnosticSerializationFile.clear(); + // Don't treat warnings as errors. + Compiler.getDiagnosticOpts().Warnings.push_back("no-error"); // Create the compiler's actual diagnostics engine. Compiler.createDiagnostics(DiagConsumer, /*ShouldOwnClient=*/false); if (!Compiler.hasDiagnostics()) diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp --- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp +++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp @@ -506,7 +506,6 @@ } AdjustedArgs.push_back("-Xclang"); AdjustedArgs.push_back("-sys-header-deps"); - AdjustedArgs.push_back("-Wno-error"); if (!HasResourceDir) { StringRef ResourceDir =