blob: d73a03001676121ee2842ea6c65a5057bf150410 [file] [log] [blame]
// { dg-do run }
template <class STRUCT, class MEMBER> inline STRUCT *
setback(MEMBER *bp, MEMBER STRUCT::*offset)
{
if(!bp) return 0;
union { int i; MEMBER STRUCT::*of; } u;
u.of = offset;
return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
}
struct S
{
int i;
};
int main()
{
S s;
S* sp = setback (&s.i, &S::i);
}