Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / compilerplugins / clang / test / putpoolitem.cxx
blobfb44612a00f4fc0b819cc391f3eda42e0fc4e810
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <memory>
12 class SfxPoolItem
14 public:
15 virtual ~SfxPoolItem();
17 class SfxPoolItemSubclass : public SfxPoolItem
20 class SfxItemSet
22 public:
23 void Put(SfxPoolItem&);
26 void foo(SfxItemSet* pSet)
28 std::unique_ptr<SfxPoolItemSubclass> foo;
29 SfxItemSet aSet;
30 // expected-error@+1 {{could use std::move? [loplugin:putpoolitem]}}
31 aSet.Put(*foo);
33 // expected-error@+1 {{could use std::move? [loplugin:putpoolitem]}}
34 pSet->Put(*foo);
37 class Foo2
39 std::unique_ptr<SfxPoolItemSubclass> m_foo;
40 void foo()
42 SfxItemSet aSet;
43 // no warning expected
44 aSet.Put(*m_foo);
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */