And also this one (bug 7109):

class test
{
public:
    test();
    int member;
};

class testStruct
{
public:
 testStruct();
 test t;
};

int i = __builtin_offsetof (testStruct, t);
>clang -cc1 offsetof1.cpp
offsetof1.cpp:15:9: warning: offset of on non-POD type 'testStruct'
int i = __builtin_offsetof (testStruct, t);
        ^                               ~
1 warning generated.

---

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);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to