News for hackers. Stuff that matters.
Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by terrymah on Tuesday August 06, 2024 @07:42AM (#41169864)
No, calling throw in a noexcept function is a defined behavior (call std::terminate), and that behavior is not a diagnostic

I think maybe WG21 was concerned a compiler engineer would be clever if throwing in noexcept were UB, for example and assume any block that throws is unreachable and could just be removed along with all blocks it postdominates. Compiler guys love optimizations that just remove code. The fastest and smallest code is code that can’t run and doesn’t exist

Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by account42 on Wednesday August 07, 2024 @05:40AM (#41179700)
Compilers are allowed to and do diagnose defined but undesirable behavior though, even more so if that's only enabled with an option.
Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by terrymah on Wednesday August 07, 2024 @05:49PM (#41185952)
Until yesterday I thought I was the only person in the world who thought the designed behavior was undesirable, though