URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [offsetof1.C] - Rev 325
Go to most recent revision | Compare with Previous | Blame | View Log
// PR c++/27601
// { dg-do compile }
struct bar {
static int foo;
static int baz();
};
int a = __builtin_offsetof(bar, foo); // { dg-error "static data member" }
int av = __builtin_offsetof(volatile bar, foo); // { dg-error "static data member" }
int b = __builtin_offsetof(bar, baz); // { dg-error "member function" }
int b0 = __builtin_offsetof(bar, baz[0]); // { dg-error "function" }
int bv0 = __builtin_offsetof(volatile bar, baz[0]); // { dg-error "function" }
int c = __builtin_offsetof(bar, ~bar); // { dg-error "member function" }
typedef int I;
enum E { };
int d = __builtin_offsetof(I, ~I); // { dg-error "destructor" }
int e = __builtin_offsetof(E, ~E); // { dg-error "destructor" }
Go to most recent revision | Compare with Previous | Blame | View Log