[C++,testcase,committed] PR 56611

Submitted by Paolo Carlini on March 13, 2013, 11:46 a.m.

Details

Message ID 51406714.9010106@oracle.com
State New
Headers show

Commit Message

Paolo Carlini March 13, 2013, 11:46 a.m.
Hi,

I'm committing the testcase and closing the issue as already fixed in 
mainline.

Thanks,
Paolo.

////////////////////////
2013-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

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

Patch hide | download patch | download mbox

Index: g++.dg/cpp0x/alias-decl-32.C
===================================================================
--- g++.dg/cpp0x/alias-decl-32.C	(revision 0)
+++ g++.dg/cpp0x/alias-decl-32.C	(working copy)
@@ -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;