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.