summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/offsetof7.C
blob: 0ce2ee02aa8639907a2ae65c0581c16d70585a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/50608
// Testcase by <dberger@oubliette.org>
// { dg-do compile }

struct A {
    int offset;
};

struct B: public A {
};

struct C {
    A a;
    B b;
};

int fails = __builtin_offsetof (C, b.offset);