Example for Rule 12–1–1 - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18) +--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19) +---- Forum: 6.12 Special member functions (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=141) +---- Thread: Example for Rule 12–1–1 (/showthread.php?tid=604) |
Example for Rule 12–1–1 - pkruk - 24-12-2008 Hello, I'm not sure if the example for this rule is correct in one case. Simplified code: Code: class B2 Why is this typeid non compliant? It does not use object’s dynamic type so it should not be a violation of the rule. This is similar to using typeid on e.g. not polymorphic type, which is allowed by the rule. ISO/IEC 14882:2003(E) standard: Quote:5.2.8 Re: Example for Rule 12–1–1 - misra cpp - 11-10-2016 The example is incorrect. It should be “typeid(*this)†and will be modified in a Technical Corrigendum |