zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2k stars 592 forks source link

C++ exceptions should have a noexcept copy constructor and assignment operator #2358

Open bernardnormier opened 4 days ago

bernardnormier commented 4 days ago

Related to: https://github.com/zeroc-ice/ice-demos/issues/146

All C++ local exceptions should follow this rule.

For generated user exceptions with user-specified fields, it should be true when the fields are noexcept copy-constructible and assignable. Unfortunately we can't provide this guarantee for user exceptions with fields that aren't noexcept copy-constructible (like std::string) without breaking source compatibility. We could try to disable this diagnostics for such generated user exceptions.