For rule S1238, which indicates when a const&
is cheaper than a pass by value, in case of overridden methods, I think the warning should be raised on the base virtual method.
This is especially true when the base class is included from an external library. In this case, we have no way to fix the issue, and have to mark it as Won’t Fix.
We’re using SonarQube Data Center Edition Version 10.3 (build 82913).
The following code on Compiler Explorer should be enough to raise the warning.
I apologize if the issue has been raised before. I tried searching but came up empty.
Let me know if you think this makes sense.
Best regards,
Luís