When using g++ I pass a template parameter as the member variable to offsetof, and I get the following warning:
invalid access to non-static data member 'SomeClass::t' of NULL object
(perhaps the 'offsetof' macro was used incorrectly)
Here is what my usage looks like:
template<typename T> class SomeClass { T t; };
...
offsetof(SomeClass, t); //warning: invalid access to non-static data member 'SomeClass::t' of NULL object, (perhaps the 'offsetof' macro was used incorrectly)
I get the same error using __builtin_offsetof. Any ideas?
Thanks