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
fix
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
anon6.C
1
extern "C" void abort ();
2
3
struct A {
4
union {
5
int a;
6
double b;
7
int d;
8
};
9
int c;
10
};
11
12
struct B : public A {
13
union {
14
double a;
15
void *c;
16
};
17
float b;
18
int e;
19
};
20
21
int main ()
22
{
23
struct B b;
24
25
b.a = 1.5;
26
b.b = 2.5;
27
b.d = 1;
28
b.e = 2;
29
if (b.a != 1.5 || b.b != 2.5 || b.d != 1 || b.e != 2)
30
abort ();
31
b.c = &b.a;
32
b.d = b.e;
33
if (b.c != &b.a || b.d != 2)
34
abort ();
35
return 0;
36
}