1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
11 #include <rtl/ref.hxx>
22 std::unique_ptr
<int> m_pbar1
;
23 rtl::Reference
<Foo
> m_pbar2
;
26 // expected-error@-1 {{no need to explicitly init an instance of 'std::unique_ptr<int>' with nullptr, just use default constructor [loplugin:simplifyconstruct]}}
28 // expected-error@-1 {{no need to explicitly init an instance of 'rtl::Reference<Foo>' with nullptr, just use default constructor [loplugin:simplifyconstruct]}}
34 // no warning expected when using std::unique_ptr constructor with a custom deleter
46 std::unique_ptr
<IUnknown
, void (*)(IUnknown
* p
)> aITypeLibGuard(nullptr, [](IUnknown
* p
) {
62 // expected-error@+1 {{simplify [loplugin:simplifyconstruct]}}
63 rtl::Reference
<Foo
> x
= rtl::Reference(f
);
67 // no warning expected
75 void f(Foo
* f
) { auto x
= rtl::Reference(f
); }
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */