repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
opt
/
nrv14.C
blob
22526d6b59a4e9a9379108e14f678212ae33b2bf
1
// PR c++/32992
2
// { dg-do run }
3
// { dg-options "-O2" }
4
5
extern "C" void abort (void);
6
7
struct A
8
{
9
long int a1;
10
long int a2;
11
long int a3;
12
};
13
14
struct B
15
{
16
long int f[3];
17
operator A ()
18
{
19
union
20
{
21
long int t[3];
22
A a;
23
};
24
for (int i = 0; i < 3; i++)
25
t[i] = f[i];
26
return a;
27
}
28
};
29
30
int
31
main ()
32
{
33
B b = { {1, 3, 5} };
34
A a = b;
35
36
if (a.a1 != b.f[0] || a.a2 != b.f[1] || a.a3 != b.f[2])
37
abort ();
38
return 0;
39
}