1// { dg-do assemble } 2 3struct A 4{ 5 void f() {} 6 7 template <class U> 8 void f() {} 9}; 10 11 12template <class T> 13struct B 14{ 15 void f() {} 16 17 template <class U> 18 void f() {} 19}; 20 21template struct B<int>; 22 23struct C 24{ 25 template <class U> 26 void f() {} // { dg-error "with" } redeclaration 27 28 template <class U> 29 void f() {} // { dg-error "overloaded" } redeclaration 30}; 31 32 33template <class T, class U> 34struct D 35{ 36 void f(T); 37 void f(U); 38}; 39 40template struct D<int, double>; 41 42template <class T, class U> 43struct D2 44{ 45 void f(T); // { dg-error "with" } redeclaration 46 void f(U); // { dg-error "overloaded" } redeclaration 47}; 48 49template struct D2<int, int>; 50 51struct E 52{ 53 void f(); // { dg-error "with" } redeclaration 54 void f(); // { dg-error "overloaded" } redeclaration 55}; 56 57