autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
1.03k stars 655 forks source link

fix(autoware_obstacle_cruise_planner): fix clang-diagnostic-delete-abstract-non-virtual-dtor #9419

Closed kobayu858 closed 1 week ago

kobayu858 commented 1 week ago

Description

This is a fix based on clang-tidy clang-diagnostic-delete-abstract-non-virtual-dtor and clang-diagnostic-delete-non-abstract-non-virtual-dtor error.

/usr/include/c++/11/bits/unique_ptr.h:85:2: error: delete called on 'PlannerInterface' that is abstract but has non-virtual destructor [clang-diagnostic-delete-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/include/c++/11/bits/unique_ptr.h:361:4: note: in instantiation of member function 'std::default_delete<PlannerInterface>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/planning/autoware_obstacle_cruise_planner/src/node.cpp:490:28: note: in instantiation of member function 'std::unique_ptr<PlannerInterface>::~unique_ptr' requested here
ObstacleCruisePlannerNode::ObstacleCruisePlannerNode(const rclcpp::NodeOptions & node_options)
                           ^
/usr/include/c++/11/bits/unique_ptr.h:85:2: error: delete called on non-final 'OptimizationBasedPlanner' that has virtual functions but non-virtual destructor [clang-diagnostic-delete-non-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/include/c++/11/bits/unique_ptr.h:361:4: note: in instantiation of member function 'std::default_delete<OptimizationBasedPlanner>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/planning/autoware_obstacle_cruise_planner/src/node.cpp:548:22: note: in instantiation of member function 'std::unique_ptr<OptimizationBasedPlanner>::~unique_ptr' requested here
      planner_ptr_ = std::make_unique<OptimizationBasedPlanner>(
                     ^
/usr/include/c++/11/bits/unique_ptr.h:85:2: error: delete called on non-final 'PIDBasedPlanner' that has virtual functions but non-virtual destructor [clang-diagnostic-delete-non-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/include/c++/11/bits/unique_ptr.h:361:4: note: in instantiation of member function 'std::default_delete<PIDBasedPlanner>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

github-actions[bot] commented 1 week ago

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 29.94%. Comparing base (e901751) to head (efa30d6). Report is 25 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9419 +/- ## ========================================== - Coverage 29.94% 29.94% -0.01% ========================================== Files 1338 1339 +1 Lines 103359 103380 +21 Branches 40236 40236 ========================================== + Hits 30954 30958 +4 - Misses 69405 69424 +19 + Partials 3000 2998 -2 ``` | [Flag](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9419/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | Coverage Δ | | *Carryforward flag | |---|---|---|---| | [differential](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | `13.06% <100.00%> (?)` | | | | [total](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | `29.94% <ø> (ø)` | | Carriedforward from [e901751](https://app.codecov.io/gh/autowarefoundation/autoware.universe/commit/e9017515ab29571e772b160316ddd259a237353e?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: