gcc/testsuite/g++.old-deja/g++.other/field2.C
raw| 1 | // { dg-do run } |
| 2 | // Test for proper handling of field calls. |
| 3 | // Contributed by Jason Merrill <[email protected]> |
| 4 | |
| 5 | struct A { |
| 6 | inline A* operator()() { return this; } |
| 7 | }; |
| 8 | |
| 9 | struct B { |
| 10 | int i; |
| 11 | union { A a; }; |
| 12 | }; |
| 13 | |
| 14 | int |
| 15 | main () |
| 16 | { |
| 17 | B b; |
| 18 | A* ap = &b.a; |
| 19 | A* ap2 = b.a(); |
| 20 | return (ap != ap2); |
| 21 | } |