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 @@ -252,11 +252,9 @@ if (CachedResourceDir != Cache.end()) return CachedResourceDir->second; - std::vector PrintResourceDirArgs{ClangBinaryName}; - if (ClangCLMode) - PrintResourceDirArgs.push_back("/clang:-print-resource-dir"); - else - PrintResourceDirArgs.push_back("-print-resource-dir"); + const std::array PrintResourceDirArgs{ + ClangBinaryName, + ClangCLMode ? "/clang:-print-resource-dir" : "-print-resource-dir"}; llvm::SmallString<64> OutputFile, ErrorFile; llvm::sys::fs::createTemporaryFile("print-resource-dir-output",