diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-19 09:21:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-19 09:04:21 +0100 |
commit | e354b3fb803397fef2a6309fc0cf714a315bedee (patch) | |
tree | 41cdbb9a00a786e1e4bed2a2f23e509fcaebb6a2 /compilerplugins | |
parent | 238d65f6823012ddc6820a82ace89ab4be43243e (diff) |
loplugin:redundantpointerops add some more smart pointer types
Change-Id: Ia7f3441404d8d2e5de501e70da496b6fdc6c9a4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90728
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/redundantpointerops.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compilerplugins/clang/redundantpointerops.cxx b/compilerplugins/clang/redundantpointerops.cxx index 1539588c1e36..7012365aaef3 100644 --- a/compilerplugins/clang/redundantpointerops.cxx +++ b/compilerplugins/clang/redundantpointerops.cxx @@ -178,12 +178,17 @@ bool RedundantPointerOps::isSmartPointerType(const Expr* e) // written is derived from std::unique_ptr or std::shared_ptr for which the get // member function is declared at a base class): auto const tc2 = loplugin::TypeCheck(e->getType()); - if ((tc2.ClassOrStruct("unique_ptr").StdNamespace() + if (tc2.ClassOrStruct("unique_ptr").StdNamespace() || tc2.ClassOrStruct("shared_ptr").StdNamespace() - || (tc2.Class("Reference").Namespace("uno").Namespace("star") - .Namespace("sun").Namespace("com").GlobalNamespace()) + || tc2.Class("Reference").Namespace("uno").Namespace("star") + .Namespace("sun").Namespace("com").GlobalNamespace() || tc2.Class("Reference").Namespace("rtl").GlobalNamespace() - || tc2.Class("SvRef").Namespace("tools").GlobalNamespace())) + || tc2.Class("SvRef").Namespace("tools").GlobalNamespace() + || tc2.Class("WeakReference").Namespace("tools").GlobalNamespace() + || tc2.Class("ScopedReadAccess").Namespace("Bitmap").GlobalNamespace() + || tc2.Class("ScopedVclPtrInstance").GlobalNamespace() + || tc2.Class("VclPtr").GlobalNamespace() + || tc2.Class("ScopedVclPtr").GlobalNamespace()) { return true; } |