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
2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
template
/
union1.C
blob
9019c38a28543ea26a2809fb12bd3aaf47dfff34
1
// { dg-do run }
2
3
extern "C" void abort ();
4
5
void g (char c)
6
{
7
if (c != 'a')
8
abort ();
9
}
10
11
void h (int i)
12
{
13
if (i != 3)
14
abort ();
15
}
16
17
template <typename T> void f(T const &t)
18
{
19
union { char c; T t_; };
20
21
c = 'a';
22
g (c);
23
t_ = 3;
24
h (t_);
25
}
26
27
int main () {
28
f (3);
29
}