2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
authordgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Dec 2007 21:12:41 +0000 (21:12 +0000)
committerdgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Dec 2007 21:12:41 +0000 (21:12 +0000)
       PR c++/34101
       * name-lookup.c (arg_assoc_template_arg): Recurse on argument
       packs.
       (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
       since arg_assoc_template_arg will deal with them (better).

2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>

       PR c++/34101
       * g++.dg/cpp0x/variadic-ttp.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130608 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic-ttp.C [new file with mode: 0644]

index f694c88..0ade8cd 100644 (file)
@@ -1,5 +1,13 @@
 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
 
+       PR c++/34101
+       * name-lookup.c (arg_assoc_template_arg): Recurse on argument
+       packs.
+       (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
+       since arg_assoc_template_arg will deal with them (better).
+
+2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
+
        PR c++/33509
        * pt.c (tsubst_exception_specification): Handle substitutions into
        member templates, where tsubst_pack_expansion returns a
index a7bb710..98c866f 100644 (file)
@@ -4477,6 +4477,17 @@ arg_assoc_template_arg (struct arg_lookup *k, tree arg)
       else
        return arg_assoc_class (k, ctx);
     }
+  /* It's an argument pack; handle it recursively.  */
+  else if (ARGUMENT_PACK_P (arg))
+    {
+      tree args = ARGUMENT_PACK_ARGS (arg);
+      int i, len = TREE_VEC_LENGTH (args);
+      for (i = 0; i < len; ++i) 
+       if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, i)))
+         return true;
+
+      return false;
+    }
   /* It's not a template template argument, but it is a type template
      argument.  */
   else if (TYPE_P (arg))
@@ -4612,15 +4623,6 @@ arg_assoc_type (struct arg_lookup *k, tree type)
       return false;
     case TYPE_PACK_EXPANSION:
       return arg_assoc_type (k, PACK_EXPANSION_PATTERN (type));
-    case TYPE_ARGUMENT_PACK:
-      {
-        tree args = ARGUMENT_PACK_ARGS (type);
-        int i, len = TREE_VEC_LENGTH (args);
-        for (i = 0; i < len; i++)
-          if (arg_assoc_type (k, TREE_VEC_ELT (args, i)))
-            return true;
-      }
-      break;
 
     default:
       gcc_unreachable ();
index a4fc563..5407e15 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
+
+       PR c++/34101
+       * g++.dg/cpp0x/variadic-ttp.C: New.
+
 2007-12-04  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
        
        * gcc.dg/parse-decl-after-if.c: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ttp.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ttp.C
new file mode 100644 (file)
index 0000000..41f1c1d
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-options -std=c++0x }
+// PR c++/34101
+template<typename> struct A {};
+
+template<template<typename> class...> struct B {};
+
+template<template<typename> class T> void foo(const B<T>&);
+
+void bar()
+{
+  foo(B<A>());
+}