repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Daily bump.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr89698.C
blob
fbeb7976c0fe5c6b63c1f4580713f499e54a6189
1
/* { dg-do run } */
2
3
extern "C" void abort (void);
4
5
class A {
6
virtual void f(){};
7
public:
8
int x;
9
A(int in): x(in) {};
10
};
11
12
class B: public A {
13
public:
14
int y;
15
B(int in):A(in-1), y(in) {};
16
};
17
18
int test(void)
19
{
20
int res;
21
B b(2);
22
A* bp = &b;
23
void* vp = dynamic_cast<void*>(bp);
24
if (((A*)vp)->x == 1 && ((B*)vp)->y == 2)
25
return 1;
26
return 0;
27
}
28
int main() { if (test() != 1) abort (); return 0; }