summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/field2.C
blob: 5dd1e97fb2703e7d83d5458ae18f9e4bf2ec0d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do run  }
// 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);
}