diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f8d523024c2..e57edc5a14c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-02 Jason Merrill + + PR c++/61134 + * pt.c (pack_deducible_p): Handle canonicalization. + 2014-06-02 Paolo Carlini * pt.c (tsubst_function_type): Initialize arg_types. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2b9ca204bdc..d267a5c1d92 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15765,7 +15765,7 @@ pack_deducible_p (tree parm, tree fn) continue; for (packs = PACK_EXPANSION_PARAMETER_PACKS (type); packs; packs = TREE_CHAIN (packs)) - if (TREE_VALUE (packs) == parm) + if (template_args_equal (TREE_VALUE (packs), parm)) { /* The template parameter pack is used in a function parameter pack. If this is the end of the parameter list, the diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic158.C b/gcc/testsuite/g++.dg/cpp0x/variadic158.C new file mode 100644 index 00000000000..cc5c24ddc67 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic158.C @@ -0,0 +1,24 @@ +// PR c++/61134 +// { dg-do compile { target c++11 } } + +struct Base { }; + +template +struct Fixed { + typedef const char* name; +}; + +template +void New(const char* name, + typename Fixed::name... field_names); + +template +void CreateMetric(const char* name, + typename Fixed::name... field_names, + const Base&) { } + + +void Fn() +{ + CreateMetric("abcd", "def", Base()); +}