@@ -1996,8 +1996,9 @@ void CheckOther::checkConstPointer()
19961996 nonConstPointers.emplace (var);
19971997 }
19981998 for (const Variable *p: pointers) {
1999+ bool inconclusive = false ;
19992000 if (p->isArgument ()) {
2000- if (!p->scope () || !p->scope ()->function || p->scope ()->function ->isImplicitlyVirtual (true ) || p->scope ()->function ->hasVirtualSpecifier ())
2001+ if (!p->scope () || !p->scope ()->function || p->scope ()->function ->isImplicitlyVirtual (false , ( bool *) nullptr , &inconclusive ) || p->scope ()->function ->hasVirtualSpecifier ())
20012002 continue ;
20022003 if (p->isMaybeUnused ())
20032004 continue ;
@@ -2014,12 +2015,12 @@ void CheckOther::checkConstPointer()
20142015 continue ;
20152016 if (p->typeStartToken () && p->typeStartToken ()->isSimplifiedTypedef () && !(Token::simpleMatch (p->typeEndToken (), " *" ) && !p->typeEndToken ()->isSimplifiedTypedef ()))
20162017 continue ;
2017- constVariableError (p, p->isArgument () ? p->scope ()->function : nullptr );
2018+ constVariableError (p, p->isArgument () ? p->scope ()->function : nullptr , &inconclusive );
20182019 }
20192020 }
20202021}
20212022
2022- void CheckOther::constVariableError (const Variable *var, const Function *function)
2023+ void CheckOther::constVariableError (const Variable *var, const Function *function, bool * inconclusive )
20232024{
20242025 if (!var) {
20252026 reportError (nullptr , Severity::style, " constParameter" , " Parameter 'x' can be declared with const" );
@@ -2050,7 +2051,7 @@ void CheckOther::constVariableError(const Variable *var, const Function *functio
20502051 id += " Pointer" ;
20512052 }
20522053
2053- reportError (std::move (errorPath), Severity::style, id.c_str (), message, CWE398, Certainty::normal);
2054+ reportError (std::move (errorPath), Severity::style, id.c_str (), message, CWE398, (inconclusive && *inconclusive) ? Certainty::inconclusive : Certainty::normal);
20542055}
20552056
20562057// ---------------------------------------------------------------------------
0 commit comments