OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
* lib/obj-c++.exp (obj-c++_target_compile): Declare global variable,
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
thunk1.C
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
}