diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/auto5.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/auto5.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto5.C b/gcc/testsuite/g++.dg/cpp0x/auto5.C new file mode 100644 index 000000000..ebe2df22e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto5.C @@ -0,0 +1,22 @@ +// Testcase for non-dependent auto in templates +// { dg-options "-std=c++0x" } + +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>(); +} |