Actions
Bug #12805
closedsun_fc: in C++11 this 'throw' will call 'terminate' because destructors default to 'noexcept'
Start date:
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
Description
Build errors with gcc 10:
../common/Listener.cc: In destructor 'Listener::~Listener()': ../common/Listener.cc:84:6: error: in C++11 this 'throw' will call 'terminate' because destructors default to 'noexcept' [-Werror=c++11-compat] 84 | throw; | ^~~~~ cc1plus: all warnings being treated as errors
We have type T as pointer to Listener, so no any exceptions at all.
----
From standard since C++11 n3690.pdf:
23.3.7.5 vector modifiers
iterator erase(const_iterator position);
iterator erase(const_iterator first, const_iterator last);
Throws: Nothing unless an exception is thrown by the copy constructor,
move constructor, assignment operator, or move assignment operator of T.
Also here https://en.cppreference.com/w/cpp/container/vector/erase
Testing done: build/install/boot but I have no FC stack to test with.
Updated by Electric Monk almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit f7c0877265657617150d9e7010f62fd4554ca9e5
commit f7c0877265657617150d9e7010f62fd4554ca9e5 Author: Toomas Soome <tsoome@me.com> Date: 2020-06-03T17:38:31.000Z 12805 sun_fc: in C++11 this 'throw' will call 'terminate' because destructors default to 'noexcept' Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Actions