OSDN Git Service

2003-01-08 Larin Hennessey <larin@science.oregonstate.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.jason / ref10.C
1 // Test that conversion from D* to B*& works properly.
2
3 extern "C" int printf (const char *, ...);
4
5 struct V {
6   int a;
7 };
8
9 struct B: virtual V {
10   int b;
11 };
12
13 struct D: B {
14   int c;
15 };
16
17 V* gp = 0;
18
19 void foo(V * const &r) {
20   gp = r;
21 }
22
23 int bar(V *r) {
24   return (r != gp);
25 }
26
27 int main() {
28   D *p = new D;
29   foo(p);
30   return bar(p);
31 }