Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clang warning: bugprone-use-after-move #2116

Merged
merged 1 commit into from
Mar 5, 2023

Conversation

mauropasse
Copy link
Collaborator

@mauropasse mauropasse commented Mar 3, 2023

Fix clang warning: bugprone-use-after-move
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html

The fix is explicitly break from a for loop after the final message has been delivered.
Even if it we know we will exit the for loop,since we check

if (std::next(it) == subscription_ids.end()) {

this is not enough for clang-tidy and it complains.

Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a good idea. I'll kick off CI for it.

@clalancette
Copy link
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit 1a9b117 into ros2:rolling Mar 5, 2023
@mauropasse mauropasse deleted the mauro/fix-clang-warning branch March 6, 2023 13:15
alsora pushed a commit to irobot-ros/rclcpp that referenced this pull request Apr 28, 2023
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
alsora pushed a commit to irobot-ros/rclcpp that referenced this pull request Apr 29, 2023
otamachan pushed a commit to otamachan/rclcpp that referenced this pull request Mar 20, 2024
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
otamachan pushed a commit to otamachan/rclcpp that referenced this pull request Mar 20, 2024
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
otamachan pushed a commit to otamachan/rclcpp that referenced this pull request Mar 20, 2024
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Tamaki Nishino <otamachan@gmail.com>
mjcarroll pushed a commit that referenced this pull request Mar 29, 2024
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Signed-off-by: Tamaki Nishino <otamachan@gmail.com>
Co-authored-by: mauropasse <mauropasse@hotmail.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants