gcc/testsuite/g++.dg/cpp0x/auto5.C
raw| 1 | // Testcase for non-dependent auto in templates |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct A |
| 5 | { |
| 6 | template<class> void f(); |
| 7 | } a; |
| 8 | |
| 9 | template <class T> |
| 10 | void g() |
| 11 | { |
| 12 | auto aa = a; |
| 13 | aa.f<int>(); |
| 14 | |
| 15 | auto p = new auto (a); |
| 16 | p->f<int>(); |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | g<double>(); |
| 22 | } |