The analyzer has detected two methods with identical implementations. Although having two identical functions is not an error, they should still be reviewed.
The diagnostic rule detects the following error types:
class Point
{
....
int GetX() { return mX; }
int GetY() { return mX; }
};
A typo causes two logically different methods to perform the same actions. The fixed code:
int GetX() { return mX; }
int GetY() { return mY; }
In the example, the identical bodies of the GetX() and GetY() methods indicate an error. However, issuing warnings for all identical methods could result in many false positives. Therefore, the analyzer has a number of exceptions where a warning about identical method bodies is not required.
Some examples of exceptions:
bool IsXYZ() { return true; };throw() statement;You can look at examples of errors detected by the V6032 diagnostic. |
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders:
Take
a chance!