| 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: |
| 7 |
foo() { } |
| 8 |
}; |
| 9 |
|
| 10 |
template<class T> class bar : public foo<T> { |
| 11 |
public: |
| 12 |
bar() : foo<T>() {} |
| 13 |
}; |
| 14 |
|
| 15 |
template<class T> class ben : public foo<T> { |
| 16 |
public: |
| 17 |
ben() : foo<T>() {} |
| 18 |
void grid(T (*f)(bar<T>&),bar<T>& x,bar<T>& y,bar<T>& param); |
| 19 |
}; |
| 20 |
|
| 21 |
template<class T> void ben<T>::grid(T (*f)(bar<T>&),bar<T>& x,bar<T>& y,bar<T>& param) { } |
| 22 |
|
| 23 |
template<class T> T gnc(bar<T>& a) |
| 24 |
{ |
| 25 |
return 0; |
| 26 |
} |
| 27 |
|
| 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 |
} |