Wenn ich g++ verwende, übergebe ich einen Template-Parameter als Member-Variable an offsetof und erhalte die folgende Warnung:
invalid access to non-static data member 'SomeClass::t' of NULL object
(perhaps the 'offsetof' macro was used incorrectly)
So sieht meine Nutzung aus:
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)
Ich erhalte den gleichen Fehler mit __builtin_offsetof. Irgendwelche Ideen?
Danke