Fixed #7553 (False positive with 1.74 'returning an integer in a function with pointer return type' when no integer is used)

This commit is contained in:
Daniel Marjamäki 2016-07-29 21:53:58 +02:00
parent ab59a6e19d
commit 66d0d7a0ad
2 changed files with 8 additions and 1 deletions

View File

@ -73,7 +73,7 @@ void Check64BitPortability::pointerassignment()
if (!returnType)
continue;
if (retPointer && returnType->pointer == 0U)
if (retPointer && !returnType->typeScope && returnType->pointer == 0U)
returnIntegerError(tok);
if (!retPointer && returnType->pointer >= 1U)

View File

@ -168,6 +168,13 @@ private:
"}");
ASSERT_EQUALS("", errout.str());
check("struct Foo {};\n"
"\n"
"int* dostuff(Foo foo) {\n"
" return foo;\n"
"}");
ASSERT_EQUALS("", errout.str());
check("int foo(char* c) {\n"
" return c;\n"
"}");