name - 2021-07-06

Hello! In the list of cppcheck rules there is <error id="virtualCallInConstructor"
I've written a call to a virtual functions in several classes in my solution and run cppcheck o them, but it dind't show tis error. I used GUi and also run from command line with --enable=style and --enable=all
How can I make cppcheck to show this issue?
I'm using cppcheck 2.5

class A
{
public:
    A() { }
    virtual void fin() = 0;
};

class B : public A
{
public:
    B() { fin(); }
    void fin() { std::cout << "l"; }
};

class C : public B
{
public:
    C() {}
    void fin() { std::cout << "c"; }
};

UPDATE: I've checked version 1.8 and it shows this error. It also found memory leak that 2.5 wasn't showing.. Is there some option I need to pass to 2.5 to show more errors?

 

Last edit: name 2021-07-07