![]() |
Rule 6.8.4 clarification of amplification - 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++:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=188) +---- Forum: 4.6 Basic concepts (https://forum.misra.org.uk/forumdisplay.php?fid=192) +---- Thread: Rule 6.8.4 clarification of amplification (/showthread.php?tid=1747) |
Rule 6.8.4 clarification of amplification - kth - 08-08-2025 The amplification of rule 6.8.4 leads with this sentence to clarify to which member functions this rule applies: Quote:This rule applies to member functions with reference or pointer return type, where, in the definition of the function, at least one The usage of the word “designates” here is ambiguous. Does it mean the expression . . .
Depending on which interpretation is true, the following code examples are either compliant or non-compliant: Code: class A { The intent of the rule seem to support meaning number 2, which would mean only A::Get is non-compliant. If that is the case, we suggest to replace “designates” with a less ambiguous phrase, e.g. “references/points to” or to explain more clearly what is meant in the amplification. In addition, clarifying examples for these cases would be helpful. |