Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / compilerplugins / clang / test / trivialdestructor.cxx
blobb6ba4e9681937be67a2cadb684bdb72ed77b70b5
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 struct S1
12 // expected-note@+1 {{previous declaration is here [loplugin:trivialdestructor]}}
13 ~S1();
16 // expected-error@+1 {{no need for explicit destructor decl [loplugin:trivialdestructor]}}
17 S1::~S1() {}
19 struct S2
21 // expected-note@+1 {{previous declaration is here [loplugin:trivialdestructor]}}
22 ~S2();
25 // expected-error@+1 {{no need for explicit destructor decl [loplugin:trivialdestructor]}}
26 S2::~S2() = default;
28 struct S3
30 ~S3() = delete;
33 struct S4
35 union {
36 int i;
37 float f;
39 // expected-error@+1 {{no need for explicit destructor decl [loplugin:trivialdestructor]}}
40 ~S4() {}
43 struct Nontrivial
45 ~Nontrivial();
48 struct S5
50 union {
51 int i;
52 Nontrivial n;
54 ~S5() {}
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */