// { dg-do run } // PRMS Id: 6826 // Check that unnecessary templates are not instantiated. template class Test { public: void doThiss(); void doThat(); }; template void Test::doThiss() { T x; x.thiss(); } template void Test::doThat() { T x; x.that(); } class A { public: void thiss() {} }; class B { public: void that() {} }; int main() { Test a; a.doThiss(); // a.doThat() is not well formed, but then // it's not used so needn't be instantiated. Test b; b.doThat(); // simillarly b.doThiss(); }