Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / ext / packed3.C
blob3494ff4c31eeffac30baef82e7329b43386b3b2e
1 // { dg-do compile }
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 void Ref (int &p);
11 void Ref (Unpacked &p);
13 struct  __attribute__ ((packed)) Packed
15   char c;
16   int i;
17   Unpacked u;
20 void Foo (Packed &p)
22   Ref (p.i); // { dg-error "cannot bind packed field" "" { target { ! default_packed } } }
23   Ref (p.u.i);
24   Ref (p.u); // { dg-error "cannot bind packed field" "" { target { ! default_packed } } }