@@ -2008,8 +2008,9 @@ void CheckOther::checkConstPointer()
20082008 nonConstPointers.emplace (var);
20092009 }
20102010 for (const Variable *p: pointers) {
2011+ bool inconclusive = false ;
20112012 if (p->isArgument ()) {
2012- if (!p->scope () || !p->scope ()->function || p->scope ()->function ->isImplicitlyVirtual (true ) || p->scope ()->function ->hasVirtualSpecifier ())
2013+ if (!p->scope () || !p->scope ()->function || p->scope ()->function ->isImplicitlyVirtual (false , ( bool *) nullptr , &inconclusive ) || p->scope ()->function ->hasVirtualSpecifier ())
20132014 continue ;
20142015 if (p->isMaybeUnused ())
20152016 continue ;
@@ -2026,12 +2027,12 @@ void CheckOther::checkConstPointer()
20262027 continue ;
20272028 if (p->typeStartToken () && p->typeStartToken ()->isSimplifiedTypedef () && !(Token::simpleMatch (p->typeEndToken (), " *" ) && !p->typeEndToken ()->isSimplifiedTypedef ()))
20282029 continue ;
2029- constVariableError (p, p->isArgument () ? p->scope ()->function : nullptr );
2030+ constVariableError (p, p->isArgument () ? p->scope ()->function : nullptr , &inconclusive );
20302031 }
20312032 }
20322033}
20332034
2034- void CheckOther::constVariableError (const Variable *var, const Function *function)
2035+ void CheckOther::constVariableError (const Variable *var, const Function *function, bool * inconclusive )
20352036{
20362037 if (!var) {
20372038 reportError (nullptr , Severity::style, " constParameter" , " Parameter 'x' can be declared with const" );
@@ -2062,7 +2063,7 @@ void CheckOther::constVariableError(const Variable *var, const Function *functio
20622063 id += " Pointer" ;
20632064 }
20642065
2065- reportError (std::move (errorPath), Severity::style, id.c_str (), message, CWE398, Certainty::normal);
2066+ reportError (std::move (errorPath), Severity::style, id.c_str (), message, CWE398, (inconclusive && *inconclusive) ? Certainty::inconclusive : Certainty::normal);
20662067}
20672068
20682069// ---------------------------------------------------------------------------
0 commit comments