[Libreoffice-commits] core.git: compilerplugins/clang

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 10 10:47:03 UTC 2018


 compilerplugins/clang/test/useuniqueptr.cxx |    4 ++--
 compilerplugins/clang/useuniqueptr.cxx      |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 88738347f81be508a639dd75f3a8627bee21d20a
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Dec 9 10:12:13 2018 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Mon Dec 10 11:46:41 2018 +0100

    cppcheck: incorrectStringBooleanError
    
    Change-Id: I7f4bce8444c6c022d856d20b06de4a4834148ea2
    Reviewed-on: https://gerrit.libreoffice.org/64834
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/compilerplugins/clang/test/useuniqueptr.cxx b/compilerplugins/clang/test/useuniqueptr.cxx
index 5f20c734958c..74f8ae10a0bb 100644
--- a/compilerplugins/clang/test/useuniqueptr.cxx
+++ b/compilerplugins/clang/test/useuniqueptr.cxx
@@ -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
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index 3aabbccf991a..1f0f9d649317 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -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")


More information about the Libreoffice-commits mailing list