aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C
blob: 296356b713f8e95c3879c94492e22f1181dcc350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Build then link:

// Special g++ Options: -frepo -Werror

// Submitted by Melissa O'Neill <oneill@cs.sfu.ca>
// the vtable of Foo<int> wouldn't be generated

template <typename A>
struct Foo {
   virtual void foo() {}
};

template <typename A>
struct Bar {   
   void bar();
};

template <typename A> 
void Bar<A>::bar() {
   Foo<A> oof;
}

int main () {
    Bar<int> rab;
    
    rab.bar();
}