Versions Compared

Key

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

...

In either case, f() must be the final overrider, guaranteeing consistent behavior of the function being called.

Risk Assessment

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

OOP50-CPP

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

LDRA tool suite
Include Page
LDRA_V
LDRA_V

467 S, 92 D

Fully implemented

Parasoft C/C++test
Include Page
cplusplus:
Parasoft_V
cplusplus:
Parasoft_V
OOP-16
 

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

4260, 4261, 4273, 4274,
4275, 4276, 4277, 4278,
4279, 4280, 4281, 4282

 


Clang
Include Page
Clang_V
Clang_V
clang-analyzer-alpha.cplusplus.VirtualCallChecked by clang-tidy
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
S1699
 

Related Vulnerabilities

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

Bibliography

[Dewhurst 2002]Gotcha #75, "Calling Virtual Functions in Constructors and Destructors"
[ISO/IEC 14882-2014]

Subclause 5.5, "Pointer-to-Member Operators"

[Lockheed Martin 2005]AV Rule 71.1, "A class'
€™s
s virtual functions shall not be invoked from its destructor or any of its constructors"
[Sutter 2004]Item 49, "Avoid Calling Virtual Functions in Constructors and Destructors"

...


...