Class: better check if there are friends. ticket: #2459

This commit is contained in:
Daniel Marjamäki 2011-01-22 17:35:54 +01:00
parent f947955c63
commit 1e25d74ba4
1 changed files with 4 additions and 5 deletions

View File

@ -583,11 +583,6 @@ void CheckClass::privateFunctions()
if (Token::findmatch(_tokenizer->tokens(), "; __property ;")) if (Token::findmatch(_tokenizer->tokens(), "; __property ;"))
return; return;
// skip checking if there are friends
// Todo: check if each class has friends
if (Token::findmatch(_tokenizer->tokens(), "friend"))
return;
// #2407 calls from operator() is not detected // #2407 calls from operator() is not detected
// TODO: Don't bailout. Detect the call. // TODO: Don't bailout. Detect the call.
if (Token::findmatch(_tokenizer->tokens(), "operator ( )")) if (Token::findmatch(_tokenizer->tokens(), "operator ( )"))
@ -609,6 +604,10 @@ void CheckClass::privateFunctions()
if (!scope->derivedFrom.empty()) if (!scope->derivedFrom.empty())
continue; continue;
// skip checking if there are friends
if (!scope->friendList.empty())
continue;
// Locate some class // Locate some class
const Token *tok1 = scope->classDef; const Token *tok1 = scope->classDef;