diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C new file mode 100644 index 0000000..aa21ddd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C @@ -0,0 +1,23 @@ +// PR c++/52043 +// { dg-do compile { target c++11 } } +// { dg-options "-Wreturn-type" } + +template < class T > struct Container +{ + T f (); +}; + +template < class T > +T deref (T) +{} // { dg-warning "no return" } + +template < class T, class ... Args > +auto deref (T u, int, Args ... args)->decltype (deref (u.f (), args ...)) +{} // { dg-warning "no return" } + +void +foo () +{ + Container < Container < int > > v; + deref (v, 2); +} |