re PR c++/54318 ([C++11] Bogus "template instantiation depth exceeds maximum" error...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 3 May 2013 09:35:42 +0000 (09:35 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 3 May 2013 09:35:42 +0000 (09:35 +0000)
2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54318
* g++.dg/cpp0x/pr54318.C: New.

From-SVN: r198573

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr54318.C [new file with mode: 0644]

index 88ac42033b719ba5eab70d409cb33795cc4ebded..b7163534e820f0bc1473d53eb50b2554ace36f00 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54318
+       * g++.dg/cpp0x/pr54318.C: New.
+
 2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/14283
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr54318.C b/gcc/testsuite/g++.dg/cpp0x/pr54318.C
new file mode 100644 (file)
index 0000000..4dac31b
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/54318
+// { dg-do compile { target c++11 } }
+
+template <typename T>
+struct wrapped
+{
+  typedef T type;
+};
+
+template <typename T>
+typename T::type unwrap1(T);
+
+int unwrap(int);
+
+template <typename T>
+auto unwrap(T t) -> decltype(unwrap(unwrap1(t)))
+{
+  return unwrap(unwrap1(t));
+}
+
+int main()
+{
+  unwrap(wrapped<wrapped<int>>());
+}