MISRA.VIRTUAL.NOVIRTUALOverriding virtual function declared with no 'virtual' keyword. MISRA-C++ Rule 10—3—2 (required): Each overriding virtual function shall be declared with the virtual keywordRationaleDeclaring overriding virtual functions with the virtual keyword removes the need to check the base class to determine whether a function is virtual. Exampleclass A { public: virtual void g(); virtual void b(); }; class B1 : public A { public: virtual void g(); // Compliant - explicitly declared "virtual" void b(); // Non-compliant - implicitly virtual }; |