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