repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
ref10.C
blob
4fe6ffdaf43f5a016c9b5300dd033aa2137adaae
1
// { dg-do run }
2
// Test that conversion from D* to B*& works properly.
3
4
extern "C" int printf (const char *, ...);
5
6
struct V {
7
int a;
8
};
9
10
struct B: virtual V {
11
int b;
12
};
13
14
struct D: B {
15
int c;
16
};
17
18
V* gp = 0;
19
20
void foo(V * const &r) {
21
gp = r;
22
}
23
24
int bar(V *r) {
25
return (r != gp);
26
}
27
28
int main() {
29
D *p = new D;
30
foo(p);
31
return bar(p);
32
}