Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
Include Page
Clang_38_V
Clang_38_V
cert-err60-cppChecked by clang-tidy
Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C++3508
Parasoft C/C++test

Include Page
Parasoft_V
Parasoft_V

CERT_CPP-ERR60-a
CERT_CPP-ERR60-b

Exception objects must be nothrow copy constructible
An explicitly declared copy constructor for a class that inherits from 'std::exception' should have a non-throwing exception specification

PRQA QA-C++
Include Page
PRQA QA-C++_VPRQA QA-C++_V

3508

Related Vulnerabilities

Search for other vulnerabilities resulting from the violation of this rule on the CERT website.

...