]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/56611 ([C++11] Template instantiation failure with variadic arguments and...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 13 Mar 2013 11:44:32 +0000 (11:44 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 13 Mar 2013 11:44:32 +0000 (11:44 +0000)
2013-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/56611
* g++.dg/cpp0x/alias-decl-32.C: New.

From-SVN: r196631

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-32.C [new file with mode: 0644]

index f4af3d5c34cd34d63e6f05e599516fbd287431c9..9fa73bef3a771988ef5c4a427cb53392ea6f94b9 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/56611
+       * g++.dg/cpp0x/alias-decl-32.C: New.
+
 2013-03-11  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/56571
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-32.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-32.C
new file mode 100644 (file)
index 0000000..1a4797e
--- /dev/null
@@ -0,0 +1,25 @@
+// PR c++/56611
+// { dg-do compile { target c++11 } }
+
+template<class T> struct remove_reference     { typedef T type; };
+template<class T> struct remove_reference<T&> { typedef T type; };
+template<class T> T declval() { return T(); }
+
+int f(int, int){return 0;}
+struct Func{};
+
+template<class... Args> struct result1
+{
+  typedef decltype(f(declval<typename remove_reference<Args>::type>()...)) type;
+};
+
+template<class... Args> using result2
+= decltype(f(declval<typename remove_reference<Args>::type>()...));
+
+template<class Sig> struct R;
+template<class This, class... Args> struct R< This(Args...) > 
+{
+  typedef result2<Args...> type;
+};
+
+typedef R< Func(int, int) >::type R_type;