diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 14:33:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 18:32:33 +0200 |
commit | 11bdb6b9d9df991bb4ee48d4682458facaa2bdd5 (patch) | |
tree | 29180dbac55048e038c404769d059780f39f21a3 /compilerplugins/clang/test/referencecasting.cxx | |
parent | c69e5e3cc08bfbb4a5f6c756c523e4016c8fd1dd (diff) |
improve loplugin:referencecasting
to catch a few more cases
Change-Id: I0323fba51bb2b4ba255e1db5aa0d890c5c6a2e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93726
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/test/referencecasting.cxx')
-rw-r--r-- | compilerplugins/clang/test/referencecasting.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/referencecasting.cxx b/compilerplugins/clang/test/referencecasting.cxx index 87324bb86fd6..0272bc89cc98 100644 --- a/compilerplugins/clang/test/referencecasting.cxx +++ b/compilerplugins/clang/test/referencecasting.cxx @@ -147,4 +147,13 @@ struct Test13 } }; +void test14(css::uno::Sequence<css::uno::Reference<css::io::XStreamListener>> seq) +{ + for (sal_Int32 i = 0; i < seq.getLength(); ++i) + { + // expected-error@+1 {{the source reference is already a subtype of the destination reference, just use = [loplugin:referencecasting]}} + css::uno::Reference<css::io::XStreamListener> xDataSeries(seq[i], css::uno::UNO_QUERY); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |