missingReturn; Fixed FP when function is declared in macro
This commit is contained in:
parent
4ecf3ccd17
commit
ef0af26d9f
|
@ -259,7 +259,7 @@ void CheckFunctions::checkMissingReturn()
|
|||
continue;
|
||||
if (function->type != Function::Type::eFunction && function->type != Function::Type::eOperatorEqual)
|
||||
continue;
|
||||
if (Token::Match(function->retDef, "void %name%"))
|
||||
if (Token::Match(function->retDef, "void| %name% ("))
|
||||
continue;
|
||||
const Token *errorToken = checkMissingReturnScope(scope->bodyEnd);
|
||||
if (errorToken)
|
||||
|
|
|
@ -1373,6 +1373,9 @@ private:
|
|||
check("int f() {}");
|
||||
ASSERT_EQUALS("[test.cpp:1]: (error) Found a exit path from function with non-void return type that has missing return statement\n", errout.str());
|
||||
|
||||
check("F(A,B) { x=1; }");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// switch
|
||||
check("int f() {\n"
|
||||
" switch (x) {\n"
|
||||
|
|
Loading…
Reference in New Issue