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 these situations when the terminate() function can be called implicitly:

  • 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.

    • A throw expression with no operand rethrows an uncaught exception.

  • A class destructor throws an exception. This also violates MISRA C++:2008 Rule 15-5-1.

Troubleshooting

If you expect a rule violation but do not see it, refer to the documentation for Polyspace® Bug Finder™ or Polyspace Bug Finder Server™.

Check Information

Group: Exception Handling
Category: Required
Introduced in R2018a