3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com>
6 // Packed fields are unsuitable for direct reference binding.
8 struct Unpacked { int i; };
10 int ConstRef (int const &p, int const *ptr, int v)
19 int ConstRef (Unpacked const &p, Unpacked const *ptr, int v)
28 int Val (int p, int v)
34 int Val (Unpacked p, int v)
41 struct __attribute__ ((packed)) Packed
49 int Foo (Packed &p, int i, int ui)
53 if ((r = Val (p.i, i)))
55 if ((r = Val (p.u.i, ui)))
57 if ((r = Val (p.u, ui)))
60 if ((r = ConstRef (p.i, &p.i, i)))
75 return Foo (p, 0x3456789a, 0xbcdef00f);