MISRA C++:2008 Rule 15-5-3
The terminate() function shall not be called implicitly
Description
Rule Definition
The terminate() function shall not be called implicitly.
Polyspace Implementation
The checker flags situations that might result in calling the function
std::terminate()
implicitly. These situations might include:
An exception escapes uncaught. This also violates
MISRA C++:2008 Rule 15-3-2
. For instance:Before an exception is caught, it escapes through another function that throws an uncaught exception. For instance, a catch statement or exception handler invokes a copy constructor that throws an uncaught exception.
An empty
throw
expression raises an uncaught exception again.
A class destructor raises an exception. Exceptions in destructors also violates
MISRA C++:2008 Rule 15-5-1
.A termination handler that is passed to
std::atexit
raises an unhandled exception.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Exception Handling |
Category: Required |