missingReturn; ensure Function::returnsVoid returns true when there is unknown macro 'void STDCALL foo() {}'
This commit is contained in:
parent
e4ecfd7be8
commit
24c17916af
|
@ -2689,6 +2689,15 @@ bool Function::returnsVoid(const Function* function, bool unknown)
|
|||
// Check for unknown types, which could be a void type
|
||||
if (isUnknownType(function->retDef, defEnd))
|
||||
return unknown;
|
||||
if (unknown) {
|
||||
// void STDCALL foo()
|
||||
const Token *def;
|
||||
bool isVoid = false;
|
||||
for (def = function->retDef; def && def->isName(); def = def->next())
|
||||
isVoid |= (def->str() == "void");
|
||||
if (isVoid && def && !Token::Match(def, "*|&|&&"))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1379,6 +1379,9 @@ private:
|
|||
check("auto foo4() -> void {}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void STDCALL foo() {}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("int f() {\n"
|
||||
"back:\n"
|
||||
" return 0;\n"
|
||||
|
|
Loading…
Reference in New Issue