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)
|
if (!function)
|
||||||
return false;
|
return false;
|
||||||
if (function->type != Function::eFunction)
|
if (function->type != Function::eFunction && function->type != Function::eOperatorEqual)
|
||||||
return false;
|
return false;
|
||||||
const Token* defEnd = function->returnDefEnd();
|
const Token* defEnd = function->returnDefEnd();
|
||||||
if (defEnd->strAt(-1) == "void")
|
if (defEnd->strAt(-1) == "void")
|
||||||
|
|
|
@ -1398,6 +1398,9 @@ private:
|
||||||
check("void STDCALL foo() {}");
|
check("void STDCALL foo() {}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("void operator=(int y) { x=y; }");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("int f() {\n"
|
check("int f() {\n"
|
||||||
"back:\n"
|
"back:\n"
|
||||||
" return 0;\n"
|
" return 0;\n"
|
||||||
|
|
Loading…
Reference in New Issue