repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Flatten anonymous structs in CodeView types
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
local7.C
blob
96b19fc64c9f061cac69eb188a482848c562b69b
1
// { dg-do assemble }
2
3
template <class STRUCT, class MEMBER> inline STRUCT *
4
setback(MEMBER *bp, MEMBER STRUCT::*offset)
5
{
6
if(!bp) return 0;
7
union { int i; MEMBER STRUCT::*of; } u;
8
u.of = offset;
9
return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
10
}
11
12
13
struct S
14
{
15
int i;
16
};
17
18
int main()
19
{
20
S s;
21
22
S* sp = setback (&s.i, &S::i);
23
}