Commit ba796308 by Douglas Gregor Committed by Doug Gregor

re PR c++/34101 (ICE with argument deduction of variadic template function)

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++/34101
       * g++.dg/cpp0x/variadic-ttp.C: New.

From-SVN: r130608
parent 3d57f0f0
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
......
......@@ -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 ();
......
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.
// { 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>());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment