Fix #5605 part 2 - now endless recursion within CheckClass::isMemberFunc()

This commit is contained in:
Alexander Mai 2014-03-30 08:31:02 +02:00
parent 1bbd1b3c49
commit bf335217cd
2 changed files with 8 additions and 1 deletions

View File

@ -1697,7 +1697,7 @@ bool CheckClass::isMemberFunc(const Scope *scope, const Token *tok) const
const Type *derivedFrom = scope->definedType->derivedFrom[i].type;
// find the function in the base class
if (derivedFrom && derivedFrom->classScope) {
if (derivedFrom && derivedFrom->classScope && !derivedFrom->hasCircularDependencies()) {
if (isMemberFunc(derivedFrom->classScope, tok))
return true;
}

View File

@ -4801,6 +4801,13 @@ private:
" 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());
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());
}