2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / field2.C
blob5dd1e97fb2703e7d83d5458ae18f9e4bf2ec0d7c
1 // { dg-do run  }
2 // Test for proper handling of field calls.
3 // Contributed by Jason Merrill <jason@cygnus.com>
5 struct A {
6   inline A* operator()() { return this; }
7 };
9 struct B {
10   int i;
11   union { A a; };
14 int
15 main ()
17   B b;
18   A* ap = &b.a;
19   A* ap2 = b.a();
20   return (ap != ap2);