...
Guarantee | Description | Example |
|---|---|---|
Strong | The strong exception safety guarantee is a property of an operation such that, in addition to satisfying the basic exception safety guarantee, if the operation terminates by raising an exception, it has no observable effects on program state. | |
Basic | The basic exception safety guarantee is a property of an operation such that, if the operation terminates by raising an exception, it preserves program state invariants and prevents resource leaks. | Basic Exception Safety |
None | Code that provides neither the strong nor basic exception safety guarantee is not exception safe. |
...
Code that is not exception safe typically leads to resource leaks, causes the program to be left in an inconsistent or unexpected state, and ultimately results in undefined behavior at some point after the first exception is thrown.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
ERR56-CPP | High | Likely | No | NoHigh | P9 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| CodeSonar |
| ALLOC.LEAK | Leak | ||||||
| Helix QAC |
| C++4075, C++4076 | |||||||
| LDRA tool suite |
| 527 S, 56 D, 71 D | Partially implemented | ||||||
| Parasoft C/C++test |
| CERT_CPP-ERR56-a | Always catch exceptions Empty 'catch' blocks should not be used | ||||||
| Polyspace Bug Finder |
| CERT C++: ERR56-CPP | Checks for exceptions violating class invariant (rule fully covered). | ||||||
| PVS-Studio |
| V565, V1023, V5002 |
...