Skip to content

Commit 460d382

Browse files
committed
Explicitly capture "this" in lambdas
Suppresses a warning on newer compilers for -std=c++20.
1 parent c820d2b commit 460d382

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

riscv/interactive.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void sim_t::interactive_run(const std::string& cmd, const std::vector<std::strin
413413
step(1);
414414

415415
if (actual_steps < steps) {
416-
next_interactive_action = [=](){ interactive_run(cmd, {std::to_string(steps - actual_steps)}, noisy); };
416+
next_interactive_action = [=, this](){ interactive_run(cmd, {std::to_string(steps - actual_steps)}, noisy); };
417417
return;
418418
}
419419

@@ -766,7 +766,7 @@ void sim_t::interactive_until(const std::string& cmd, const std::vector<std::str
766766
step(1);
767767
}
768768

769-
next_interactive_action = [=](){ interactive_until(cmd, args, noisy); };
769+
next_interactive_action = [=, this](){ interactive_until(cmd, args, noisy); };
770770
}
771771

772772
void sim_t::interactive_dumpmems(const std::string& cmd, const std::vector<std::string>& args)

0 commit comments

Comments
 (0)