gcc/testsuite/g++.old-deja/g++.other/ref3.C
raw| 1 | // { dg-do run } |
| 2 | // Origin: Mark Mitchell <[email protected]> |
| 3 | |
| 4 | struct B1 |
| 5 | { |
| 6 | int i; |
| 7 | }; |
| 8 | |
| 9 | struct B2 |
| 10 | { |
| 11 | int j; |
| 12 | }; |
| 13 | |
| 14 | struct D: public B1, B2 |
| 15 | { |
| 16 | }; |
| 17 | |
| 18 | bool f (B2& b) |
| 19 | { |
| 20 | return b.j == 7; |
| 21 | } |
| 22 | |
| 23 | int main () |
| 24 | { |
| 25 | D d; |
| 26 | d.i = 2; |
| 27 | d.j = 7; |
| 28 | if (!f (d)) |
| 29 | return 1; |
| 30 | } |
| 31 |