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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

@github-actions github-actions bot added the component:simulation Virtual environment setups and simulations. (auto-assigned) label Nov 28, 2024
Copy link

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 tag: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
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) tag: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.

1 participant