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:
parent
ab59a6e19d
commit
66d0d7a0ad
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
"}");
|
||||
|
|
Loading…
Reference in New Issue