g++ を使用しているときに、テンプレート パラメーターをメンバー変数として offsetof に渡すと、次の警告が表示されます。
invalid access to non-static data member 'SomeClass::t' of NULL object
(perhaps the 'offsetof' macro was used incorrectly)
私の使い方は次のとおりです。
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)
__builtin_offsetof を使用しても同じエラーが発生します。何か案は?
ありがとう