Merge pull request #28 from bwy/master
Fix "auto_ptr assignment" false positive
This commit is contained in:
commit
f0a7cc5961
|
@ -1150,7 +1150,10 @@ void CheckStl::checkAutoPointer()
|
|||
autoPointerArrayError(tok2->next());
|
||||
}
|
||||
}
|
||||
autoPtrVarId.insert(tok2->next()->varId());
|
||||
if (tok2->next()->varId())
|
||||
{
|
||||
autoPtrVarId.insert(tok2->next()->varId());
|
||||
}
|
||||
break;
|
||||
}
|
||||
tok2 = tok2->next();
|
||||
|
|
|
@ -1376,6 +1376,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:6]: (style) Copy 'auto_ptr' pointer to another do not create two equal objects since one has lost its ownership of the pointer.\n", errout.str());
|
||||
|
||||
check("std::auto_ptr<A> function();\n"
|
||||
"int quit;"
|
||||
"void f() { quit = true; }\n"
|
||||
);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// ticket #748
|
||||
check("void f() \n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue