aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/field2.C
blob: 5eb67554fdf108670e5d479ae2e5ac7a02ce84fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test for proper handling of field calls.
// Contributed by Jason Merrill <jason@cygnus.com>

struct A {
  inline A* operator()() { return this; }
};

struct B {
  int i;
  union { A a; };
};

int
main ()
{
  B b;
  A* ap = &b.a;
  A* ap2 = b.a();
  return (ap != ap2);
}