]> gcc.gnu.org Git - gcc.git/commitdiff
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 7493fd2f5127faa453d6f885e3ca80e1e8b041e3..204fea6e729273a64f2855acac2fb3de0ce9e08a 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 c3c759e38aa660dbcd2c73fb1ff986c4ef1197c5..c9c25cd2c55020bc976727ab8cb1af96ac45ae9c 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 7e88ecc8b5ff00a69f94e7322a6fb89f769d20a2..2a30f6e8bbc5fe43b9de98d74f9ebfc859b46954 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;
+}
This page took 0.100108 seconds and 5 git commands to generate.