Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / compilerplugins / clang / test / unoaggregation.cxx
blob01e0dd832e9dd0aefca951064fbc3bbd569805b8
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 <sal/config.h>
12 #include <com/sun/star/lang/XInitialization.hpp>
13 #include <com/sun/star/lang/XMain.hpp>
14 #include <cppuhelper/implbase.hxx>
15 #include <cppuhelper/implbase1.hxx>
16 #include <sal/types.h>
18 class Base : public cppu::WeakAggImplHelper1<css::lang::XInitialization>
20 public:
21 void SAL_CALL initialize(css::uno::Sequence<css::uno::Any> const& aArguments) override;
24 class Good : public Base, public css::lang::XMain
26 public:
27 css::uno::Any SAL_CALL queryInterface(css::uno::Type const& aType) override
29 return Base::queryInterface(aType);
33 class Bad : public cppu::ImplInheritanceHelper<Base, css::lang::XMain>
35 public:
36 sal_Int32 SAL_CALL run(css::uno::Sequence<OUString> const& aArguments) override;
39 // expected-error@cppuhelper/implbase.hxx:* {{'ImplInheritanceHelper<Base, com::sun::star::lang::XMain>' derives from XAggregation, but its implementation of queryInterface does not delegate to an appropriate base class queryInterface [loplugin:unoaggregation]}}
40 Bad bad; //make sure Bad's base cppu::ImplInheritanceHelper<Base, css::lang::XMain> is instantiated
42 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */