URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [local1.C] - Rev 338
Compare with Previous | Blame | View Log
// { 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);
}