Some clang versions fail otherwise:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/exception_ptr.h:172:9: error: destructor called on non-final 'simgrid::kernel::context::Context::StopRequest' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
{ static_cast<_Ex*>(__x)->~_Ex(); }
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/exception_ptr.h:185:21: note: in instantiation of function template specialization 'std::__exception_ptr::__dest_thunk<simgrid::kernel::context::Context::StopRequest>' requested here
__exception_ptr::__dest_thunk<_Ex>);
^
/builds/workspace/SimGrid/build_mode/Debug/node/simgrid-manjaro/build/SimGrid-3.21.90/src/simix/ActorImpl.cpp:507:35: note: in instantiation of function template specialization 'std::make_exception_ptr<simgrid::kernel::context::Context::StopRequest>' requested here
actor->throw_exception(std::make_exception_ptr(simgrid::kernel::context::Context::StopRequest("host failed")));
^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/exception_ptr.h:172:34: note: qualify call to silence this warning
{ static_cast<_Ex*>(__x)->~_Ex(); }
^
1 error generated.
public:
StopRequest() = default;
explicit StopRequest(std::string msg) : msg_(std::string("Actor killed (") + msg + std::string(").")) {}
- virtual const char* what() const noexcept { return msg_.c_str(); }
+ const char* what() const noexcept { return msg_.c_str(); }
private:
std::string msg_ = std::string("Actor killed.");