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
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
virtual4.C
blob
0cbd23c366ca8831217b5907a6480cf8590b9fc4
1
// { dg-do run }
2
// Origin: Mark Mitchell <mark@codesourcery.com>
3
4
struct B
5
{
6
B ();
7
virtual void f () = 0;
8
};
9
10
B::B ()
11
{
12
}
13
14
extern B* bp;
15
16
template <class T>
17
struct C : public B
18
{
19
virtual void f ()
20
{
21
}
22
};
23
24
template <class T>
25
struct D : public B
26
{
27
virtual void f ()
28
{
29
bp = new C<T*>;
30
}
31
};
32
33
B* bp = new D<int>;
34
35
int main ()
36
{
37
bp->f ();
38
bp->f ();
39
}
40
41