1 // { dg-do run  }
2 // PRMS Id: 6826
3 // Check that unnecessary templates are not instantiated.
4 
5 template <class T>
6 class Test
7 {
8  public:
9   void doThiss();
10   void doThat();
11 };
12 
13 template <class T>
doThiss()14 void Test<T>::doThiss()
15 {
16   T x;
17 
18   x.thiss();
19 }
20 
21 template <class T>
doThat()22 void Test<T>::doThat()
23 {
24   T x;
25 
26   x.that();
27 }
28 
29 class A
30 {
31  public:
thiss()32   void thiss() {}
33 };
34 
35 class B
36 {
37  public:
that()38   void that() {}
39 };
40 
main()41 int main()
42 {
43   Test<A> a;
44   a.doThiss();			// a.doThat() is not well formed, but then
45 				// it's not used so needn't be instantiated.
46 
47   Test<B> b;
48   b.doThat();			// simillarly b.doThiss();
49 }
50