]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/61134 ([C++11] bogus "no matching function for call...")
authorJason Merrill <jason@redhat.com>
Mon, 9 Jun 2014 19:56:21 +0000 (15:56 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 9 Jun 2014 19:56:21 +0000 (15:56 -0400)
PR c++/61134
* pt.c (pack_deducible_p): Handle canonicalization.

From-SVN: r211387

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/variadic158.C [new file with mode: 0644]

index c4d2dee85cc8a22c09dd88de9d519c996704c6fe..f3d7c8c9c72996fa5f7493ef4f8717a90a91b38d 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/61134
+       * pt.c (pack_deducible_p): Handle canonicalization.
+
 2014-05-22  Release Manager
 
        * GCC 4.8.3 released.
index 724707b5a0de6580857d7f5bacdccb12833600cb..85b46fe0809c64642a5b54e61031bbc83c3862c0 100644 (file)
@@ -14934,7 +14934,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 (file)
index 0000000..cc5c24d
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/61134
+// { dg-do compile { target c++11 } }
+
+struct Base { };
+
+template <typename>
+struct Fixed {
+  typedef const char* name;
+};
+
+template <typename VT, typename... Fields>
+void New(const char* name,
+         typename Fixed<Fields>::name... field_names);
+
+template <typename VT, typename... Fields>
+void CreateMetric(const char* name,
+                  typename Fixed<Fields>::name... field_names,
+                  const Base&) { }
+
+
+void Fn()
+{
+  CreateMetric<int, const char*>("abcd", "def", Base());
+}