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
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
dcast2.C
blob
bd343a7e61d7500e808c4b1fbded9fd1cc971304
1
// Build don't link:
2
3
// Based on a testcase by Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
4
5
struct B {
6
virtual ~B();
7
};
8
9
struct D : public B {
10
};
11
12
void foo() {
13
B x;
14
dynamic_cast<D*>(&x); // WARNING - will never succeed
15
B* p = &x;
16
dynamic_cast<D*>(p);
17
}