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++.other
/
thunk1.C
blob
35243f529838199976e365d9e92a0dcb347d616f
1
// { dg-do run }
2
extern "C" void abort();
3
4
int ic;
5
6
struct X
7
{
8
X() { ++ic; }
9
X( const X & ) { ++ic; }
10
~X() { if (--ic < 0) abort(); }
11
};
12
13
struct V
14
{
15
virtual ~V() {}
16
};
17
18
struct A : public virtual V
19
{
20
};
21
22
struct B : public virtual V
23
{
24
virtual void foo( X ) = 0;
25
};
26
27
struct D : public A, public virtual B
28
{
29
virtual void foo( X ) {}
30
};
31
32
int main()
33
{
34
B *b = new D;
35
b->foo( X() );
36
}