1 // { dg-do run }
2 // PRMS Id: 1502
3 // Bug: g++ fails to resolve 'gnc' in the call to 'grid'.
4
5 template<class T> class foo {
6 public:
foo()7 foo() { }
8 };
9
10 template<class T> class bar : public foo<T> {
11 public:
bar()12 bar() : foo<T>() {}
13 };
14
15 template<class T> class ben : public foo<T> {
16 public:
ben()17 ben() : foo<T>() {}
18 void grid(T (*f)(bar<T>&),bar<T>& x,bar<T>& y,bar<T>& param);
19 };
20
grid(T (* f)(bar<T> &),bar<T> & x,bar<T> & y,bar<T> & param)21 template<class T> void ben<T>::grid(T (*f)(bar<T>&),bar<T>& x,bar<T>& y,bar<T>& param) { }
22
gnc(bar<T> & a)23 template<class T> T gnc(bar<T>& a)
24 {
25 return 0;
26 }
27
main()28 int main()
29 {
30 ben<double> a;
31 bar<double> x,y,p;
32 a.grid(gnc,x,y,p);
33 return 0;
34 }
35