1// { dg-do assemble } 2template <class STRUCT, class MEMBER> inline STRUCT * 3setback(MEMBER *bp, MEMBER STRUCT::*offset) 4{ 5 // The implementation of this function may be platform dependend 6 if(!bp) return 0; // NULL pointers remain NULL 7 union { int i; MEMBER STRUCT::*of; } u; // Switch types. Casting won't work. 8 u.of = offset; 9 return (STRUCT *) ((int) bp - u.i); 10} 11 12