/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace Unnamed
{ namespace
{ struct S
{ struct
{ struct
{ int i;
} s2; struct// anonymous struct extension (widely supported)
{ int j;
}; int k;
} s1; #iffalse//TODO: see corresponding TODO in compilerplugins/clang/unusedmember.cxx static constexpr struct
{ int l; // expected-error {{unused class member [loplugin:unusedmember]}}
} s = {}; #endif typedefstruct
{ int m; // expected-error {{unused class member [loplugin:unusedmember]}}
} t; // expected-error {{unused class member [loplugin:unusedmember]}}
};
} void f()
{
(void)sizeof(S); #iffalse//TODO: see corresponding TODO in compilerplugins/clang/unusedmember.cxx
(void)S::s; // avoid "unused variable 's'" (non-loplugin) warning #endif
}
}
namespace Offsetof
{ namespace
{ struct S
{ int i;
};
} void f() { (void)offsetof(S, i); }
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.