1// { dg-do assemble } 2// 3// Copyright (C) 2000 Free Software Foundation, Inc. 4// Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com> 5 6// bug 371 We failed to subst explicit template args before trying to 7// deduce the template. 8 9namespace N 10{ 11enum E { e0 }; 12 13template< E e > void nf(); 14 15} 16 17template< N::E e > void gf(); 18 19struct X { 20 template<N::E e> void xfn (); 21 template<N::E e> static void sfn (); 22}; 23 24template < class C > 25void tf(C *ptr) 26{ 27 N::nf<N::e0>(); 28 gf<N::e0>(); 29 ptr->X::xfn <N::e0> (); 30 ptr->C::template xfn <N::e0> (); 31 ptr->template xfn <N::e0> (); 32 ptr->X::sfn <N::e0> (); 33 ptr->C::template sfn <N::e0> (); 34 ptr->template sfn <N::e0> (); 35 X::sfn <N::e0> (); 36 C::template sfn <N::e0> (); 37} 38 39void f(X *ptr) 40{ 41 ptr->xfn <N::e0> (); 42 tf(ptr); 43} 44