OSDN Git Service

* class.c (resolve_address_of_overloaded_function): Don't
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / bitfld3.C
1 // { dg-do assemble  }
2
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
7
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.
11
12 enum E {one};
13 struct A {
14   E m1: 8;
15   E m2: 8;
16   unsigned m3 : 8;
17   unsigned m4 : 8;
18 };
19
20 int fn (int f)
21 {
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;
34 }