MISRA.PUREVIRT.OVRDPure virtual function overrides a non pure virtual function. MISRA-C++ Rule 10-3-3 (required): A virtual function shall only be overridden by a pure virtual function if it is itself declared as pure virtual.RationaleRe-declaring a function as pure may not meet developer expectations. Exampleclass A { public: virtual void foo ( ) = 0; // foo declared pure }; class B : public A { public: virtual void foo ( ) // foo defined { } }; class C: public B { public: virtual void foo ( ) = 0; // Non-compliant — foo re-declared pure }; The function 'foo' is introduced as pure (making class 'A' abstract), defined in class 'B' (making class 'B' concrete), then re-declared as pure (making class 'C' abstract). As this may not meet developer expectations, the re-declaration as pure is not allowed. |