From 0205498a124231590b647c103a8029dd2d1b2921 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sat, 6 Nov 2010 13:31:56 +0100 Subject: [PATCH] Symbol database: improved handling of out of line functions returning function pointers --- lib/checkclass.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 7250f532f..d374c798c 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -246,6 +246,23 @@ void CheckClass::addIfFunction(SpaceInfo **info, const Token **tok) else addNewFunction(info, tok); } + + // function returning function pointer with body + else if (Token::simpleMatch(argStart->link(), ") ) (") && + Token::Match(argStart->link()->tokAt(2)->link(), ") const| {")) + { + const Token *tok1 = funcStart; + + // class function + if (tok1->previous()->str() == "::") + addFunction(info, &tok1); + + // regular function + else + addNewFunction(info, &tok1); + + *tok = tok1; + } } }