Index: lib/Driver/ToolChains/Clang.cpp =================================================================== --- lib/Driver/ToolChains/Clang.cpp +++ lib/Driver/ToolChains/Clang.cpp @@ -3694,6 +3694,16 @@ if (isa(JA)) RenderAnalyzerOptions(Args, CmdArgs, Triple, Input); + // Enable compatilibily mode to avoid analyzer-config related errors. + // Since we can't access frontend flags through hasArg, let's manually iterate + // through them. + for (size_t Index = 0; Index < Args.size(); ++Index) { + if (StringRef(Args.getArgString(Index)).contains("-analyzer-config")) { + CmdArgs.push_back("-analyzer-config-compatibility-mode=true"); + break; + } + } + CheckCodeGenerationOptions(D, Args); unsigned FunctionAlignment = ParseFunctionAlignment(TC, Args); Index: test/Analysis/invalid-analyzer-config-value.c =================================================================== --- test/Analysis/invalid-analyzer-config-value.c +++ test/Analysis/invalid-analyzer-config-value.c @@ -66,6 +66,10 @@ // CHECK-NO-COMPAT: error: unknown analyzer-config 'no-false-positives' +// Test the driver properly using "analyzer-config-compatibility-mode=true", +// even if -analyze isn't specified. +// RUN: %clang -Xclang -analyzer-config -Xclang remember=TheVasa %s + // expected-no-diagnostics int main() {}