V678. An object is used as an argument to its own method. Consider checking the first actual argument of the 'Foo' function.

The analyzer has detected a call to a non-static member function in which the object itself was passed as the first argument.


This code may probably contain an error. For example, an incorrect variable name is used because of a misprint. The correct code should look like this then:


or like this:


Let's see how such misprints may affect the code in real life. Here's a fragment from a real application:

CXMLAttribute* pAttr1 =
CXMLAttribute* pAttr2 =
if ( pAttr1 && pAttr2 &&

This code should compare two attributes. But a misprint causes the value "pAttr1->GetValue()" to be compared to itself.

This is the fixed code:

if ( pAttr1 && pAttr2 &&

This diagnostic is classified as:

You can look at examples of errors detected by the V678 diagnostic.

Bugs Found

Checked Projects
Collected Errors
14 425
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →