gcc升级后编译error问题

template typename T
inline
std::size_t a(){
struct b{
uint8_t di_c;
T di_target;
};
return offsetof(b,di_target);
}
gcc4.4.7正常编译,现在用gcc7.3.0编译出错,结构体必须先被声明才能使用吗
error: 'di_target' was not declared in this scope
return offsetof(b,di_target);
error: there are no arguments to 'offsetof' that depend on a parameter, so a declaration of 'offsetof' must be available [-fpermissve]

struct b只是声明了结构,没有对应的变量。

这什么破代码写的,gcc4.4.7能编译?我不信
b不是个变量,是个类型,di_target是结构体成员
你写offsetof(b,di_target)这个到底是要干啥