gcc/testsuite/g++.dg/template/offsetof3.C
raw| 1 | // PR c++/64487 |
| 2 | |
| 3 | struct foo { |
| 4 | int member; |
| 5 | }; |
| 6 | |
| 7 | template < int N> |
| 8 | struct bar {}; |
| 9 | |
| 10 | template <int N> |
| 11 | struct qux { |
| 12 | static bar<N+__builtin_offsetof(foo,member)> static_member; |
| 13 | }; |
| 14 | |
| 15 | template <int N> |
| 16 | bar<N+__builtin_offsetof(foo,member)> qux<N>::static_member; |
| 17 | |
| 18 | int main() { } |