Uncaught exception
Exception propagates uncaught to the main or another entry-point
function
Description
This check looks for the following issues:
An uncaught exception propagates to the
mainor another entry-point function.An exception is thrown in the constructor of a global variable and not caught.
An exception is thrown in a destructor call or
deleteexpression.An exception is thrown before a previous throw expression is handled by a
catchstatement, for instance, when constructing acatchstatement parameters.A
noexceptspecification is violated. For instance, a function declared withnoexcept(true)is not supposed to throw any exceptions but an exception is thrown in the function body.
In these situations, according to the C++ standard, the
std::terminate function is called and can cause unexpected
results.
Note that the Uncaught exception check on functions from the Standard Template Library is green, even though Polyspace stubs these functions and does not check if a function throws an exception.
Diagnosing This Check
Examples
Check Information
| Group: C++ |
| Language: C++ |
| Acronym: EXC |