![]() |
Rule 10.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++:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=188) +---- Forum: 4.10 Declarations (https://forum.misra.org.uk/forumdisplay.php?fid=196) +---- Thread: Rule 10.1.1 (/showthread.php?tid=1745) |
Rule 10.1.1 - Merge - 04-08-2025 Hi, We are having a discussion with one of our tool vendors about how to interpret MISRA C++ 2023 rule 10.1.1, more concretely, the impact of the implicit 'this' parameter. I won't say which party supports which interpretation for the sake of neutrality. Example code: https://godbolt.org/z/hxz4bzvan Interpretation A) Fn() has an implicit, non-const 'this' parameter, so the rule is violated (Fn() should have been declared const). Interpretation B) Fn() does not have any parameters, so the rule is not violated. We would appreciate an unbiased opinion to settle this discussion. Best regards, Daniel "Merge" Merget RE: Rule 10.1.1 - misra cpp - 08-08-2025 We agree with interpretation B. The wording in the amplification ...'including use as the implicit this parameter of a non-const member function' may be misleading and we are considering changing it for the next release. |