diff --git a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp --- a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp +++ b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp @@ -61,7 +61,8 @@ llvm::StringSaver Saver(Alloc); llvm::cl::ExpandResponseFiles(Saver, Tokenizer, Argv, false, false, *FS, llvm::StringRef(Cmd.Directory)); - Cmd.CommandLine.assign(Argv.begin(), Argv.end()); + std::vector ExpandedArgv(Argv.begin(), Argv.end()); + Cmd.CommandLine = std::move(ExpandedArgv); } return Cmds; }