diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-12 08:22:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 07:28:35 +0100 |
commit | 397d5cbc3c04da7693e2e1f3e99b0d8e431bfff2 (patch) | |
tree | d064789b3a170293ff0f57b7f2b1b1b79159b18b /compilerplugins/clang/test/useuniqueptr.cxx | |
parent | a2f86708a5740ce9fd2a3a6ab69685d8fb53dd6c (diff) |
loplugin:useuniqueptr in Cursor
Change-Id: I5de300709409311b7a1d451ee1d314596cf2e879
Reviewed-on: https://gerrit.libreoffice.org/47836
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/test/useuniqueptr.cxx')
-rw-r--r-- | compilerplugins/clang/test/useuniqueptr.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/useuniqueptr.cxx b/compilerplugins/clang/test/useuniqueptr.cxx index 43002ec59a68..ddd30c73ae62 100644 --- a/compilerplugins/clang/test/useuniqueptr.cxx +++ b/compilerplugins/clang/test/useuniqueptr.cxx @@ -112,4 +112,16 @@ class Foo9 { delete m_pbar3; // expected-error {{unconditional call to delete on a member, should be using std::unique_ptr [loplugin:useuniqueptr]}} } }; +// no warning expected +class Foo10 { + XXX* m_pbar1; + ~Foo10() + { + if (m_pbar1 != getOther()) + { + delete m_pbar1; + } + } + XXX* getOther() { return nullptr; } +}; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |