Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / compilerplugins / clang / test / unnecessaryoverride-dtor.hxx
blobe26024be1a287476adc05cba1072bdcc7c384e16
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 #ifndef INCLUDED_COMPILERPLUGINS_CLANG_TEST_UNNECESSARYOVERRIDE_DTOR_HXX
11 #define INCLUDED_COMPILERPLUGINS_CLANG_TEST_UNNECESSARYOVERRIDE_DTOR_HXX
13 #include <sal/config.h>
15 #include <rtl/ref.hxx>
17 struct VirtualBase {
18 virtual ~VirtualBase() {}
21 struct IncludedDerived1: VirtualBase {
22 ~IncludedDerived1() override {}; // expected-error {{unnecessary user-declared destructor [loplugin:unnecessaryoverride]}}
25 struct IncludedDerived2: VirtualBase {
26 ~IncludedDerived2() override;
29 struct IncludedNotDerived {
30 ~IncludedNotDerived();
33 struct Incomplete;
34 struct IncludedDerived3: VirtualBase {
35 IncludedDerived3();
36 ~IncludedDerived3() override;
38 private:
39 IncludedDerived3(IncludedDerived3 &) = delete;
40 void operator =(IncludedDerived3) = delete;
42 rtl::Reference<Incomplete> m;
45 struct MarkedInlineButNotDefined {
46 inline ~MarkedInlineButNotDefined();
49 template<typename T> struct TemplateBase: T {
50 virtual ~TemplateBase() {}
53 #endif
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */