Query module AV Rule 71.1

name
Virtual call from constructor or destructor
description
Virtual functions should not be invoked from a constructor or destructor of the same class. Confusingly, virtual functions are resolved statically (not dynamically) in constructors and destructors for the same class. The call should be made explicitly static by qualifying it using the scope resolution operator.
kind
problem
problem.severity
warning
precision
high
id
cpp/virtual-call-in-constructor
tags
reliability readability language-features external/jsf

Imports

cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Predicates