1/* { dg-do compile } */
2
3template <typename To, typename From>
4static inline To
5bitwise_cast (From from)
6{
7  union
8    {
9      From f;
10      To t;
11    } u;
12  u.f = from;
13  return u.t;
14}
15
16extern void foo (unsigned char *);
17
18double
19bar ()
20{
21  unsigned char b[sizeof (unsigned long long)];
22  foo (b);
23  return bitwise_cast<double> (*(unsigned long long *) b);
24}
25
26