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
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.mike
/
misc14.C
blob
6f966f211ca97b7cf30611ea661a4819cb33f951
1
// { dg-do run }
2
// GROUPS passed
3
extern "C" int printf (const char *, ...);
4
extern "C" void exit(int);
5
6
class A {
7
public:
8
virtual ~A() {
9
printf("FAIL\n");
10
exit (1);
11
}
12
};
13
14
class B : public A {
15
public:
16
virtual ~B() {
17
printf("PASS\n");
18
exit (0);
19
}
20
};
21
22
int main() {
23
B b;
24
A *ap = &b;
25
ap->~A(); // This should call the destructor virtually.
26
printf("FAIL\n");
27
return 1;
28
}