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(learning_based_vehicle_model): fix clang-diagnostic-delete-abstract-non-virtual-dtor #9506

Merged

Conversation

yhisaki
Copy link
Contributor

@yhisaki yhisaki commented Nov 28, 2024

Description

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

Command: clang-tidy-14 -p build/learning_based_vehicle_model --header-filter=/home/hisaki/workspace/clang-tidy-ci/autoware/src/universe/autoware.universe/simulator/learning_based_vehicle_model/.* --config-file=.clang-tidy-ci /home/hisaki/workspace/clang-tidy-ci/autoware/src/universe/autoware.universe/simulator/learning_based_vehicle_model/src/interconnected_model.cpp
2 errors generated.
Error while processing /home/hisaki/workspace/clang-tidy-ci/autoware/src/universe/autoware.universe/simulator/learning_based_vehicle_model/src/interconnected_model.cpp.
Found compiler error(s).

/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:95:2: error: delete called on 'SubModelInterface' that is abstract but has non-virtual destructor [clang-diagnostic-delete-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:396:4: note: in instantiation of member function 'std::default_delete<SubModelInterface>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^
/home/hisaki/workspace/clang-tidy-ci/autoware/src/universe/autoware.universe/simulator/learning_based_vehicle_model/src/interconnected_model.cpp:79:23: note: in instantiation of member function 'std::unique_ptr<SubModelInterface>::~unique_ptr' requested here
  submodels.push_back(std::unique_ptr<SimplePyModel>(new_model));
                      ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:95:2: error: delete called on non-final 'SimplePyModel' that has virtual functions but non-virtual destructor [clang-diagnostic-delete-non-abstract-non-virtual-dtor]
        delete __ptr;
        ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:396:4: note: in instantiation of member function 'std::default_delete<SimplePyModel>::operator()' requested here
          get_deleter()(std::move(__ptr));
          ^
/home/hisaki/workspace/clang-tidy-ci/autoware/src/universe/autoware.universe/simulator/learning_based_vehicle_model/src/interconnected_model.cpp:79:23: note: in instantiation of member function 'std::unique_ptr<SimplePyModel>::~unique_ptr' requested here
  submodels.push_back(std::unique_ptr<SimplePyModel>(new_model));
                      ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@yhisaki yhisaki requested a review from maxime-clem as a code owner November 28, 2024 03:05
@github-actions github-actions bot added the component:simulation Virtual environment setups and simulations. (auto-assigned) label Nov 28, 2024
Copy link

github-actions bot commented Nov 28, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@yhisaki yhisaki added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 28, 2024
@yhisaki yhisaki enabled auto-merge (squash) November 28, 2024 03:06
@xmfcx xmfcx force-pushed the clang-tidy-learning_based_vehicle_model branch from 4833b74 to b225870 Compare January 14, 2025 08:09
@xmfcx xmfcx disabled auto-merge January 14, 2025 08:11
@xmfcx xmfcx enabled auto-merge (squash) January 14, 2025 08:11
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 29.47%. Comparing base (4b11912) to head (b225870).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...g_based_vehicle_model/src/interconnected_model.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9506      +/-   ##
==========================================
- Coverage   29.48%   29.47%   -0.01%     
==========================================
  Files        1444     1446       +2     
  Lines      108268   108259       -9     
  Branches    42193    42168      -25     
==========================================
- Hits        31918    31909       -9     
- Misses      73268    73271       +3     
+ Partials     3082     3079       -3     
Flag Coverage Δ *Carryforward flag
differential 27.21% <0.00%> (?)
total 29.47% <ø> (-0.01%) ⬇️ Carriedforward from 4b11912

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xmfcx xmfcx merged commit 9699892 into autowarefoundation:main Jan 14, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:simulation Virtual environment setups and simulations. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants