<div>And also this one (bug 7109):</div>
<div> </div>
<div><pre id="comment_text_0" class="bz_comment_text">class test
{
public:
test();
int member;
};
class testStruct
{
public:
testStruct();
test t;
};
int i = __builtin_offsetof (testStruct, t);
<span class="quote">>clang -cc1 offsetof1.cpp</span>
offsetof1.cpp:15:9: warning: offset of on non-POD type 'testStruct'
int i = __builtin_offsetof (testStruct, t);
^ ~
1 warning generated.</pre><pre class="bz_comment_text">---</pre>
<div class="bz_comment"><pre id="comment_text_1" class="bz_comment_text">Or is it because neither class is strictly POD?
This still has the warning:
struct test
{
public:
test();
int member;
};
struct testStruct
{
test t;
};
int i = __builtin_offsetof (testStruct, t);
But this does not:
struct test
{
int member;
};
struct testStruct
{
test t;
};
int i = __builtin_offsetof (testStruct, t);<br><br></pre></div></div>