Fix #5605 part 2 - now endless recursion within CheckClass::isMemberFunc()
This commit is contained in:
parent
1bbd1b3c49
commit
bf335217cd
|
@ -1697,7 +1697,7 @@ bool CheckClass::isMemberFunc(const Scope *scope, const Token *tok) const
|
||||||
const Type *derivedFrom = scope->definedType->derivedFrom[i].type;
|
const Type *derivedFrom = scope->definedType->derivedFrom[i].type;
|
||||||
|
|
||||||
// find the function in the base class
|
// find the function in the base class
|
||||||
if (derivedFrom && derivedFrom->classScope) {
|
if (derivedFrom && derivedFrom->classScope && !derivedFrom->hasCircularDependencies()) {
|
||||||
if (isMemberFunc(derivedFrom->classScope, tok))
|
if (isMemberFunc(derivedFrom->classScope, tok))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4801,6 +4801,13 @@ private:
|
||||||
" return 0;\n"
|
" return 0;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("[test.cpp:4] -> [test.cpp:2]: (performance, inconclusive) Technically the member function 'MixerParticipant::GetAudioFrame' can be static.\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:4] -> [test.cpp:2]: (performance, inconclusive) Technically the member function 'MixerParticipant::GetAudioFrame' can be static.\n", errout.str());
|
||||||
|
|
||||||
|
checkConst("class MixerParticipant : public MixerParticipant {\n"
|
||||||
|
" bool InitializeFileReader() {\n"
|
||||||
|
" printf(\"music\");\n"
|
||||||
|
" }\n"
|
||||||
|
"};");
|
||||||
|
ASSERT_EQUALS("[test.cpp:2]: (performance, inconclusive) Technically the member function 'MixerParticipant::InitializeFileReader' can be static.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue