Fixed #10396 (FP missingReturn on void operator=())
This commit is contained in:
parent
d0b6079a83
commit
c2305b1da7
|
@ -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")
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue