...
Throwing an exception copy-initializes a temporary object, called the exception object. The temporary is an lvalue and is used to initialize the variable declared in the matching handler.
If the copy constructor for the exception object type throws during the copy initialization, std::terminate()
is called, which can result in possibly unexpected implementation-defined behavior. For more information on implicitly calling std::terminate()
, see ERR50-CPP. Do not abruptly terminate the program.
...
Tool | Version | Checker | Description | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Clang |
| cert-err60-cpp | Checked by clang-tidy | |||||||||||
Helix QAC |
| C++3508 | ||||||||||||
Parasoft C/C++test |
| CERT_CPP-ERR60-a | Exception objects must be nothrow copy constructible | PRQA QA-C++ | ||||||||||
Include Page | PRQA QA-C++_V | PRQA QA-C++_V | 3508 |
Related Vulnerabilities
Search for other vulnerabilities resulting from the violation of this rule on the CERT website.
...