diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index f8a7ddda4..2881d894b 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -583,11 +583,6 @@ void CheckClass::privateFunctions() if (Token::findmatch(_tokenizer->tokens(), "; __property ;")) 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 // TODO: Don't bailout. Detect the call. if (Token::findmatch(_tokenizer->tokens(), "operator ( )")) @@ -609,6 +604,10 @@ void CheckClass::privateFunctions() if (!scope->derivedFrom.empty()) continue; + // skip checking if there are friends + if (!scope->friendList.empty()) + continue; + // Locate some class const Token *tok1 = scope->classDef;