Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing
|Summary:||Throw C++ exceptions by value|
|Component:||help||Assignee:||AOO issues mailing list <issues>|
|Status:||CONFIRMED ---||QA Contact:|
|Version:||3.3.0 or older (OOo)|
|Issue Type:||ENHANCEMENT||Latest Confirmation in:||---|
|Issue Depends on:||122768|
Description firstname.lastname@example.org 2014-06-16 12:59:28 UTC
Best practices for C++ suggest to catch exceptions by value. The related issue to catch exceptions by a const reference has already been addressed in issue 122768. The AOO code base contains a lot of instances where exception objects are thrown with code patterns like throw new RuntimeException() where the surrounding and catching code doesn't seem to handle that a pointer is being thrown instead of an exception. So the exception might not be caught. If the (now deprecated) throw lists come into play and if they specify the exception itself but not the pointer then this can cause pseudo-crashes because C++ requires that terminate() is being called. So the existing code with "throw new X()" should be changed to "throw X()" and the related throw-lists and catch clauses should be checked.
Comment 1 email@example.com 2014-06-16 14:38:21 UTC
As the title suggest the first sentence above should of course be: "Best practices for C++ suggest to throw exceptions by value".