OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR testsuite/25241
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
local1.C
1
// { dg-do run }
2
template <class STRUCT, class MEMBER> inline STRUCT *
3
setback(MEMBER *bp, MEMBER STRUCT::*offset)
4
{
5
if(!bp) return 0;
6
union { int i; MEMBER STRUCT::*of; } u;
7
u.of = offset;
8
return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
9
}
10
11
12
struct S
13
{
14
int i;
15
};
16
17
int main()
18
{
19
S s;
20
21
S* sp = setback (&s.i, &S::i);
22
}