Rule 10-3-3 Re-declaring pure function

Moderators: david ward, misra cpp

Posts: 5
Joined: Tue Mar 13, 2018 7:58 am
Company: Denso Create

Rule 10-3-3 Re-declaring pure function

Postby nishiyama » Tue Feb 05, 2019 3:57 am


Rules 10-3-3 Rationale has the following description.

Re-declaring a function as pure may not meet developer expectations.

What do the developers expect?
What does it mean that it does not meet the expectations of developers?

Posts: 108
Joined: Wed Apr 27, 2016 2:33 pm
Company: Elektrobit Automotive GmbH

Re: Rule 10-3-3 Re-declaring pure function

Postby dg1980 » Fri Feb 08, 2019 7:17 am


for the example provided by this rule it means:

Code: Select all

A a;// compile-time error: A is abstract
B b;// ok
C c;// compile-time error: C is abstract again

The last line is the one which does not meet common developer expectations when looking at the class hierarchy.

misra cpp
Posts: 145
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Rule 10-3-3 Re-declaring pure function

Postby misra cpp » Wed Apr 10, 2019 2:53 pm

Our belief is that the developer expectation is that deriving a class adds behaviour to the base, not removes it.
Posted by and on behalf of
the MISRA C++ Working Group

Return to “6.10 Derived classes (C++)”

Who is online

Users browsing this forum: No registered users and 0 guests