Fixed #10396 (FP missingReturn on void operator=())

This commit is contained in:
Daniel Marjamäki 2021-08-10 09:55:16 +02:00
parent d0b6079a83
commit c2305b1da7
2 changed files with 4 additions and 1 deletions

View File

@ -2692,7 +2692,7 @@ bool Function::returnsVoid(const Function* function, bool unknown)
{
if (!function)
return false;
if (function->type != Function::eFunction)
if (function->type != Function::eFunction && function->type != Function::eOperatorEqual)
return false;
const Token* defEnd = function->returnDefEnd();
if (defEnd->strAt(-1) == "void")

View File

@ -1398,6 +1398,9 @@ private:
check("void STDCALL foo() {}");
ASSERT_EQUALS("", errout.str());
check("void operator=(int y) { x=y; }");
ASSERT_EQUALS("", errout.str());
check("int f() {\n"
"back:\n"
" return 0;\n"