gcc/testsuite/g++.dg/template/lookup15.C
raw| 1 | // PR c++/94799 - member template function lookup fails. |
| 2 | |
| 3 | template<typename> |
| 4 | struct M { void fn() { } }; |
| 5 | |
| 6 | M<int>* bar (int); |
| 7 | M<int> bar2 (int); |
| 8 | |
| 9 | template<typename T> |
| 10 | struct X : M<T> { |
| 11 | void xfn () |
| 12 | { |
| 13 | this->template M<T>::fn (); |
| 14 | bar((T)1)->template M<T>::fn (); |
| 15 | bar2((T)1).template M<T>::fn (); |
| 16 | } |
| 17 | }; |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | X<int> x; |
| 23 | x.xfn(); |
| 24 | } |