Skip to content

add missing virtual destructor in base class SocketServer used by TCPSocketServer and UnixSocketServer #183

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

Closed

Conversation

matlo607
Copy link
Contributor

I got this error while building cucumber-cpp.

In file included from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/checked_delete.hpp:15:0,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/smart_ptr/shared_ptr.hpp:26,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/shared_ptr.hpp:17,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/date_time/time_clock.hpp:17,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/date_time/posix_time/posix_time_types.hpp:10,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/asio/time_traits.hpp:23,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/asio/basic_deadline_timer.hpp:28,
                 from /home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/asio.hpp:24,
                 from /home/matt/.conan/data/cucumber-cpp/0.4/murex/testing/build/232742180d6b48ffcaf9de5114f5a9b14f6df7e4/cucumber-cpp-0.4/include/cucumber-cpp/internal/connectors/wire/WireServer.hpp:8,
                 from /home/matt/.conan/data/cucumber-cpp/0.4/murex/testing/build/232742180d6b48ffcaf9de5114f5a9b14f6df7e4/cucumber-cpp-0.4/tests/integration/WireServerTest.cpp:1:
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/core/checked_delete.hpp: In instantiation of ‘void boost::checked_delete(T*) [with T = cucumber::internal::TCPSocketServer]’:
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/smart_ptr/scoped_ptr.hpp:88:30:   required from ‘boost::scoped_ptr<T>::~scoped_ptr() [with T = cucumber::internal::TCPSocketServer]’
/home/matt/.conan/data/cucumber-cpp/0.4/murex/testing/build/232742180d6b48ffcaf9de5114f5a9b14f6df7e4/cucumber-cpp-0.4/tests/integration/WireServerTest.cpp:84:7:   required from here
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/core/checked_delete.hpp:34:5: error: deleting object of polymorphic class type ‘cucumber::internal::TCPSocketServer’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]
     delete x;
     ^
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/core/checked_delete.hpp: In instantiation of ‘void boost::checked_delete(T*) [with T = cucumber::internal::UnixSocketServer]’:
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/smart_ptr/scoped_ptr.hpp:88:30:   required from ‘boost::scoped_ptr<T>::~scoped_ptr() [with T = cucumber::internal::UnixSocketServer]’
/home/matt/.conan/data/cucumber-cpp/0.4/murex/testing/build/232742180d6b48ffcaf9de5114f5a9b14f6df7e4/cucumber-cpp-0.4/tests/integration/WireServerTest.cpp:175:7:   required from here
/home/matt/.conan/data/boost/1.66.0/murex/testing/package/c4cf4727ec6abec83cfac5a4693c657b37ece27d/include/boost/core/checked_delete.hpp:34:5: error: deleting object of polymorphic class type ‘cucumber::internal::UnixSocketServer’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]

Environment:

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial
gcc (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904
boost 1.66.0

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • It is my own work, its copyright is implicitly assigned to the project and no substantial part of it has been copied from other sources (including Stack Overflow). In rare occasions this is acceptable, like in CMake modules where the original copyright information should be kept.
  • I'm using the same code standards as the existing code (indentation, spacing, variable naming, ...).
  • I've added tests for my code.
  • I have verified whether my change requires changes to the documentation
  • My change either requires no documentation change or I've updated the documentation accordingly.
  • My branch has been rebased to master, keeping only relevant commits.

@matlo607 matlo607 mentioned this pull request Feb 14, 2018
9 tasks
@matlo607
Copy link
Contributor Author

matlo607 commented Feb 14, 2018

@paoloambrosio, @muggenhor or @konserw : could you please review the pull request ?
Please ignore the commit 9827adc, konserw told me it's wrong. I will wait for #184.

@matlo607 matlo607 force-pushed the missing-virtual-constructor branch from 9827adc to 176e003 Compare March 21, 2018 17:25
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 63.307% when pulling 176e003 on matlo607:missing-virtual-constructor into 70fa12c on cucumber:master.

konserw added a commit to konserw/cucumber-cpp that referenced this pull request Mar 30, 2018
This is group-merge which consist actualy of following fixes:
* Remove -werror compiler flag to fix failing build with clang ([cucumber#184](cucumber#184) Kamil Strzempowicz)
* Add missing virtual destructor in base class SocketServer used by TCPSocketServer and UnixSocketServer ([cucumber#183](cucumber#183) Matthieu Longo)
* Fix breaking changes in API of boost-1.66.0 ([cucumber#180](cucumber#180)  Matthieu Longo)
* Fix conflicting "using std" declaration with "using boost::thread" ([cucumber#181](cucumber#181)  Matthieu Longo)
* Fixing Visual Studio 2013 error: no appropriate default constructor available ([cucumber#188](cucumber#188) Antoine Allard)
@konserw
Copy link
Contributor

konserw commented Mar 30, 2018

Merged as part of #189

@konserw konserw closed this Mar 30, 2018
@muggenhor muggenhor added this to the v0.5 milestone May 23, 2018
@matlo607 matlo607 deleted the missing-virtual-constructor branch July 16, 2018 10:40
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.

4 participants