------- Comment #3 from gdr at cs dot tamu dot edu 2006-01-23 20:57 ------- Subject: Re: New: Spurious offsetof warnings with private members
"rcbilson at plg dot uwaterloo dot ca" <[EMAIL PROTECTED]> writes: | Consider: | | #include <iostream> | #include <cstddef> | | class xxx { | friend int main(); | void *q; | public: | void *r; | }; | | int main() { | std::cout << "offset of xxx::q is " << offsetof( xxx, q ) << "\n"; | std::cout << "offset of xxx::r is " << offsetof( xxx, r ) << "\n"; | return 0; | } | | The class xxx is POD, and the two applications of offsetof should be ok (per | 18.1p5). No, the class xxx is not a POD because xxx::q is non-public. Invalid PR, should be closed. -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25927