aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/offsetof1.C
blob: 0cfabf8033c9b2cfdc9ef3de449bd22952f9e485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// PR c++/27601
// Origin: Patrik Hägglund  <patrik.hagglund@bredband.net>
// { dg-do compile }

struct bar {
  static int foo;
  static int baz();
};

int a = __builtin_offsetof(bar, foo);  // { dg-error "static data member" }
int b = __builtin_offsetof(bar, baz);  // { dg-error "member function" }
int c = __builtin_offsetof(bar, ~bar);  // { dg-error "member function" }