diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index f40758364..dec82d091 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -4047,6 +4047,10 @@ static void checkVariableCallMatch(const Variable* callarg, const Variable* func same++; return; } + if (res == ValueType::MatchResult::FALLBACK1) { + fallback1++; + return; + } bool ptrequals = callarg->isArrayOrPointer() == funcarg->isArrayOrPointer(); bool constEquals = !callarg->isArrayOrPointer() || ((callarg->typeStartToken()->strAt(-1) == "const") == (funcarg->typeStartToken()->strAt(-1) == "const")); @@ -5854,7 +5858,7 @@ ValueType::MatchResult ValueType::matchParameter(const ValueType *call, const Va return ValueType::MatchResult::NOMATCH; return ValueType::MatchResult::UNKNOWN; // TODO } - if (call->pointer > 0 && func->type != ValueType::Type::VOID && ((call->constness | func->constness) != func->constness)) + if (call->pointer > 0 && ((call->constness | func->constness) != func->constness)) return ValueType::MatchResult::NOMATCH; if (call->type != func->type) { if (call->type == ValueType::Type::VOID || func->type == ValueType::Type::VOID) diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index f5dc7f534..efce7ebbd 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -5126,7 +5126,7 @@ private: ASSERT_EQUALS(true, f && f->function() && f->function()->tokenDef->linenr() == 4); f = Token::findsimplematch(tokenizer.tokens(), "foo ( & f ) ;"); - ASSERT_EQUALS(true, f && f->function() && f->function()->tokenDef->linenr() == 5); + ASSERT_EQUALS(true, f && f->function() == nullptr); f = Token::findsimplematch(tokenizer.tokens(), "foo ( ip ) ;"); ASSERT_EQUALS(true, f && f->function() && f->function()->tokenDef->linenr() == 4);