OSDN Git Service

PR c++/9335
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / union1.C
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 }