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

avoid delete-non-virtual-dtor warning #134

Merged
merged 1 commit into from Jul 25, 2019
Merged

Conversation

Karsten1987
Copy link
Contributor

The latest master brings up two warnings about virtual destructors:

[ 96%] Building CXX object CMakeFiles/test_buffer.dir/test/test_buffer.cpp.o
In file included from /Users/karsten/workspace/osrf/ros2_full/src/ros2/geometry2/tf2_ros/test/test_buffer.cpp:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/future:366:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/system_error:150:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:500:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:644:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3706:5: error: destructor called on non-final 'MockCreateTimer' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
    __data_.second().~_Tp();
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3662:5: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<MockCreateTimer, std::__1::allocator<MockCreateTimer> >::__on_zero_shared' requested here
    __shared_ptr_emplace(_Alloc __a)
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4327:26: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<MockCreateTimer, std::__1::allocator<MockCreateTimer> >::__shared_ptr_emplace' requested here
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4706:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<MockCreateTimer>::make_shared<>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
/Users/karsten/workspace/osrf/ros2_full/src/ros2/geometry2/tf2_ros/test/test_buffer.cpp:133:33: note: in instantiation of function template specialization 'std::__1::make_shared<MockCreateTimer>' requested here
  auto mock_create_timer = std::make_shared<MockCreateTimer>();
                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3706:23: note: qualify call to silence this warning
    __data_.second().~_Tp();
                      ^
1 error generated.

This PR is fixing it. Running CI on it:

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

Signed-off-by: Karsten Knese karsten@openrobotics.org

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987 Karsten1987 added the in review Waiting for review (Kanban column) label Jul 24, 2019
@Karsten1987 Karsten1987 self-assigned this Jul 24, 2019
@Karsten1987 Karsten1987 added this to In progress in Eloquent via automation Jul 24, 2019
Eloquent automation moved this from In progress to Reviewer approved Jul 25, 2019
@Karsten1987 Karsten1987 merged commit c9430d4 into ros2 Jul 25, 2019
Eloquent automation moved this from Reviewer approved to Done Jul 25, 2019
@Karsten1987 Karsten1987 deleted the avoid_non_virtual_dtor branch July 25, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review Waiting for review (Kanban column)
Projects
No open projects
Eloquent
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants