diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto5.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto5.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto5.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto5.C new file mode 100644 index 0000000..8ed66d1 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto5.C @@ -0,0 +1,22 @@ +// Testcase for non-dependent auto in templates +// { dg-do compile { target c++11 } } + +struct A +{ + template<class> void f(); +} a; + +template <class T> +void g() +{ + auto aa = a; + aa.f<int>(); + + auto p = new auto (a); + p->f<int>(); +} + +int main() +{ + g<double>(); +} |