2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / bitfld3.C
blob7e16a72063567001eefb6477fef38bd079f449c3
1 // { dg-do assemble  }
3 // Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 4 Jun 1999 <nathan@acm.org>
5 // Derived from a bug report from Stephan Riess <riess@bfw-online.de>
6 // http://gcc.gnu.org/ml/gcc-bugs/1999-06n/msg00107.html
8 // Builtin ops don't always need reference bindings, and we weren't removing
9 // them always after doing overload resolution. This caused us to try and take
10 // the address of a bitfield.
12 enum E {one};
13 struct A {
14   E m1: 8;
15   E m2: 8;
16   unsigned m3 : 8;
17   unsigned m4 : 8;
20 int fn (int f)
22   A a;
23   E m1, m2;
24   E e;
25   int i;
26   
27   e = f ? m1 : m2;
28   e = f ? a.m1 : a.m2;
29   i = f ? a.m3 : a.m4;
30   (f ? m1 : m2) = e;
31   (f ? a.m1 : a.m2) = e;
32   (f ? a.m3 : a.m4) = i;
33   return 0;