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/.
24 void f(S s
) { (void)s
.e
; }
27 namespace ElaboratedEnum
65 enum E
// expected-error {{unused class member [loplugin:unusedmember]}}
72 void f() { (void)S::E1
; }
75 namespace UnusedDataMember
84 struct __attribute__((warn_unused
)) T
92 int i2
; // expected-error {{unused class member [loplugin:unusedmember]}}
93 int const& i3
; // expected-error {{unused class member [loplugin:unusedmember]}}
96 T t2
; // expected-error {{unused class member [loplugin:unusedmember]}}
97 T
const& t3
; // expected-error {{unused class member [loplugin:unusedmember]}}
125 void f() { (void)alignof(S
const(&)[][10]); }
138 int i
__attribute__((aligned(__alignof__(S1
))));
164 void f() { (void)sizeof(S3
); }
179 struct // anonymous struct extension (widely supported)
185 #if false //TODO: see corresponding TODO in compilerplugins/clang/unusedmember.cxx
186 static constexpr struct
188 int l
; // expected-error {{unused class member [loplugin:unusedmember]}}
193 int m
; // expected-error {{unused class member [loplugin:unusedmember]}}
194 } t
; // expected-error {{unused class member [loplugin:unusedmember]}}
200 #if false //TODO: see corresponding TODO in compilerplugins/clang/unusedmember.cxx
201 (void)S::s
; // avoid "unused variable 's'" (non-loplugin) warning
209 (void)&ElaboratedEnum::f
;
210 (void)&UnusedEnum::f
;
211 (void)&UnusedDataMember::f
;
218 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */