diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp index 1db3e66a636d..fb99b8255b05 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp @@ -31,7 +31,11 @@ static void addExtraFlags(tooling::CompileCommand &Command, } tooling::CompileCommand getDefaultCompileCommand(PathRef File) { - std::vector CommandLine{"clang", "-fsyntax-only", File.str()}; + // We don't specify --std because we want to infer it from the filename. + // We force PC because PS4 will change --std from under us. + // FIXME: there must be a more principled way to do this! + std::vector CommandLine{ + "clang", "-fsyntax-only", "-triple=unknown-pc-unknown", File.str()}; return tooling::CompileCommand(llvm::sys::path::parent_path(File), llvm::sys::path::filename(File), CommandLine, /*Output=*/"");