Conversation
Add inconclusive and default=false (instead of true) in checkConstPointer.
|
IMHO we should follow the approach used for https://trac.cppcheck.net/ticket/13282 |
Can you clarify what you object of? The inconclusion part or the warning? Before it was no warning at all, now there is but inconclusive is added since the check failed to find the base class. The inconclusion part was suggested by Daniel M. |
| if (foundAllBaseClasses) //If we've seen all the base classes and none of the above were true then it must not be virtual | ||
| return false; | ||
| return defaultVal; //If we can't see all the bases classes then we can't say conclusively | ||
| //If we can't see all the bases classes then we can't say conclusively, set inconclusive (if possible) and return default value |
There was a problem hiding this comment.
Isn't inconclusive redundant since there is pFoundAllBaseClasses already?
|
The warning should have the "either ... or" format, and be inconclusive. |
|
I agree the warning message can be clarified and it would be good to be somewhat consistent.. |



class C : public QObject
{
public:
void func01(QPoint* pt) { // <- pt can be const
if (nullptr == pt) {}
}
};
The fix adds inconclusive warning for this case, including tests.