aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clangd/CompileCommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/CompileCommands.cpp')
-rw-r--r--clang-tools-extra/clangd/CompileCommands.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp
index 80391fe..c9da98e 100644
--- a/clang-tools-extra/clangd/CompileCommands.cpp
+++ b/clang-tools-extra/clangd/CompileCommands.cpp
@@ -270,7 +270,8 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
if (auto *DashDash =
ArgList.getLastArgNoClaim(driver::options::OPT__DASH_DASH)) {
auto DashDashIndex = DashDash->getIndex() + 1; // +1 accounts for Cmd[0]
- for (unsigned I = DashDashIndex; I < Cmd.size(); ++I)
+ // Another +1 so we don't treat the `--` itself as an input.
+ for (unsigned I = DashDashIndex + 1; I < Cmd.size(); ++I)
SawInput(Cmd[I]);
Cmd.resize(DashDashIndex);
}