re PR c++/45698 (C++0x Variadic Templates: Infinite template recursion rather than...
authorJason Merrill <jason@redhat.com>
Wed, 25 May 2011 19:52:10 +0000 (15:52 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 25 May 2011 19:52:10 +0000 (15:52 -0400)
PR c++/45698
* pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT.

From-SVN: r174229

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic110.C [new file with mode: 0644]

index 7493fd2..204fea6 100644 (file)
@@ -1,5 +1,8 @@
 2011-05-25  Jason Merrill  <jason@redhat.com>
 
+       PR c++/45698
+       * pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT.
+
        PR c++/46145
        * decl.c (grokdeclarator): Complain about auto typedef.
 
index c3c759e..c9c25cd 100644 (file)
@@ -18759,6 +18759,9 @@ dependent_template_arg_p (tree arg)
   if (arg == error_mark_node)
     return true;
 
+  if (TREE_CODE (arg) == ARGUMENT_PACK_SELECT)
+    arg = ARGUMENT_PACK_SELECT_ARG (arg);
+
   if (TREE_CODE (arg) == TEMPLATE_DECL
       || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
     return dependent_template_p (arg);
index 7e88ecc..2a30f6e 100644 (file)
@@ -1,5 +1,7 @@
 2011-05-25  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/cpp0x/variadic110.C: New.
+
        * g++.dg/cpp0x/auto9.C: Add typedef test.
 
        * g++.dg/cpp0x/auto23.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic110.C b/gcc/testsuite/g++.dg/cpp0x/variadic110.C
new file mode 100644 (file)
index 0000000..86f1bb1
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/45698
+// { dg-options -std=c++0x }
+
+template <class... Ts> struct tuple { };
+
+template<class... Ts>
+struct A {
+  template<typename T> struct N { };
+  tuple<N<Ts>...> tup;
+};
+
+int main()
+{
+  A<int, double> a;
+}