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
Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
union2.C
blob
5c2d7dcac7236599359b7c7621b7f7258a34b2bb
1
// { dg-do run }
2
// Bug: g++ crashed on empty initializers for unions.
3
// Bug: gcc and g++ didn't zero unions with empty initializers.
4
// Submitted by J"orn Rennecke <amylaar@cygnus.co.uk>
5
6
extern "C" void exit (int);
7
8
typedef union u
9
{
10
union u *up;
11
void *vp;
12
} u;
13
14
static u v = {};
15
16
void bar (u);
17
void baz (u);
18
19
void foo()
20
{
21
u w = {};
22
u x = { &v };
23
baz (x);
24
bar (w);
25
}
26
27
void baz (u w) { }
28
29
void bar (u w)
30
{
31
if (w.up)
32
exit (1);
33
}
34
35
int main ()
36
{
37
foo ();
38
return 0;
39
}