1// { dg-do link } 2// GROUPS passed templates membertemplates 3extern "C" int printf(const char*, ...); 4 5struct S 6{ 7 template <class T, class U> 8 void foo(T t, U u); 9 10 template <class U> 11 void foo(char*, U); 12 13 void foo(int i); 14}; 15 16template <class T, class U> 17void S::foo(T t, U u) 18{ 19 printf ("T,U version\n"); 20} 21 22 23template <class U> 24void S::foo(char*, U u) 25{ 26 printf ("char*,U version\n"); 27} 28 29 30void S::foo(int i) 31{ 32 printf ("int version\n"); 33} 34 35 36int main() 37{ 38 S s; 39 s.foo(3); 40 s.foo(3, 3); 41 s.foo("abc", s); 42} 43 44