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
Merged r158704 through r158906 into branch.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.mike
/
dyncast8.C
blob
e2c5a2df9a60de75abd8cd5568c24297d23dccf6
1
// { dg-do run }
2
#include <typeinfo>
3
4
class Base
5
{
6
public:
7
virtual ~Base() { }
8
};
9
10
class Derived : public Base
11
{
12
public:
13
Derived() {}
14
};
15
16
int main()
17
{
18
const Derived b;
19
const Base* ap = &b;
20
21
const Derived* p1 = dynamic_cast<const Derived*>(ap);
22
return p1 == 0;
23
}