From: Jason Merrill Date: Wed, 25 May 2011 19:52:10 +0000 (-0400) Subject: re PR c++/45698 (C++0x Variadic Templates: Infinite template recursion rather than... X-Git-Tag: releases/gcc-4.7.0~6497 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=91db8b1345b0d48c4b4a082843377702a0e6c55e;p=gcc.git re PR c++/45698 (C++0x Variadic Templates: Infinite template recursion rather than an error message) PR c++/45698 * pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT. From-SVN: r174229 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7493fd2f5127..204fea6e7292 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-05-25 Jason Merrill + PR c++/45698 + * pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT. + PR c++/46145 * decl.c (grokdeclarator): Complain about auto typedef. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c3c759e38aa6..c9c25cd2c550 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e88ecc8b5ff..2a30f6e8bbc5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2011-05-25 Jason Merrill + * 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 index 000000000000..86f1bb1543c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic110.C @@ -0,0 +1,15 @@ +// PR c++/45698 +// { dg-options -std=c++0x } + +template struct tuple { }; + +template +struct A { + template struct N { }; + tuple...> tup; +}; + +int main() +{ + A a; +}