Skip to content

Commit c2305b1

Browse files
committed
Fixed #10396 (FP missingReturn on void operator=())
1 parent d0b6079 commit c2305b1

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

lib/symboldatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ bool Function::returnsVoid(const Function* function, bool unknown)
26922692
{
26932693
if (!function)
26942694
return false;
2695-
if (function->type != Function::eFunction)
2695+
if (function->type != Function::eFunction && function->type != Function::eOperatorEqual)
26962696
return false;
26972697
const Token* defEnd = function->returnDefEnd();
26982698
if (defEnd->strAt(-1) == "void")

test/testfunctions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,9 @@ class TestFunctions : public TestFixture {
13981398
check("void STDCALL foo() {}");
13991399
ASSERT_EQUALS("", errout.str());
14001400

1401+
check("void operator=(int y) { x=y; }");
1402+
ASSERT_EQUALS("", errout.str());
1403+
14011404
check("int f() {\n"
14021405
"back:\n"
14031406
" return 0;\n"

0 commit comments

Comments
 (0)