Skip to content

Commit

Permalink
cppcheck: incorrectStringBooleanError
Browse files Browse the repository at this point in the history
Change-Id: I7f4bce8444c6c022d856d20b06de4a4834148ea2
Reviewed-on: https://gerrit.libreoffice.org/64834
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
  • Loading branch information
serval2412 committed Dec 10, 2018
1 parent c56b2e3 commit 8873834
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compilerplugins/clang/test/useuniqueptr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ class Foo18 {
void foo19()
{
std::vector<char*> vec; // expected-note {{var is here [loplugin:useuniqueptr]}}
for(char * p : vec)
delete p; // expected-error {{rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]}}
for(char * p : vec) // expected-note {{var is here [loplugin:useuniqueptr]}}
delete p; // expected-error {{rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]}} expected-error {{call to delete on a var, should be using std::unique_ptr [loplugin:useuniqueptr]}}
}

// no warning expected
Expand Down
2 changes: 1 addition & 1 deletion compilerplugins/clang/useuniqueptr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void UseUniquePtr::CheckDeleteLocalVar(const FunctionDecl* functionDecl, const C
|| name == "StgDirEntry::SetSize" || name == "UCBStorage::CopyStorageElement_Impl"
|| parentName == "SfxItemSet" || parentName == "SfxItemPool"
|| name == "OutputDevice::ImplDrawPolyPolygon" || name == "OutputDevice::ImplDrawPolyPolygon"
|| name == "ImplListBox::InsertEntry" || "Edit::dispose")
|| name == "ImplListBox::InsertEntry" || name == "Edit::dispose")
return;
// very dodgy
if (name == "UCBStorage::OpenStorage_Impl")
Expand Down

0 comments on commit 8873834

Please sign in to comment.