2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / other / offsetof5.C
blob8514af087add8004587fff312c04561a62271ba0
1 // PR c++/35741
2 // { dg-do compile }
4 #include <stddef.h>
6 struct A
8   char c;
9   int &i;
12 int j = offsetof (A, i);                // { dg-message "offsetof" }
14 template <typename T>
15 struct S
17   T h;
18   T &i;
19   static const int j = offsetof (S, i); // { dg-message "offsetof" }
22 int k = S<int>::j;                      // { dg-message "required from here" }