X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.dg%2Fabi%2Foffsetof.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.dg%2Fabi%2Foffsetof.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=96f5796ec95462845ef39e9e9ec142708a7eec2e;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.dg/abi/offsetof.C b/gcc/testsuite/g++.dg/abi/offsetof.C deleted file mode 100644 index 96f5796e..00000000 --- a/gcc/testsuite/g++.dg/abi/offsetof.C +++ /dev/null @@ -1,22 +0,0 @@ -// Test that we can refer to the address of a base member of a null pointer -// to get its offset. The standard says that offsetof shall not be used on -// non-POD classes, but there seems to be no such restriction on the common -// implementation thereof. - -// Yes, this is bad, naughty, evil code. But it seems to be well-formed. -// So we'll just warn. - -// { dg-do run } - -struct A { int i; }; - -struct B: public A { - virtual void f (); -}; - -struct C: public B { }; - -int main () -{ - return ((unsigned long) &((C*)0)->i) != sizeof(void*); // { dg-warning "offsetof" "" } -}