Comments
Patch
@@ -2905,6 +2905,8 @@ make_ith_pack_parameter_name (tree name,
char* newname;
int newname_len;
+ if (name == NULL_TREE)
+ return name;
snprintf (numbuf, NUMBUF_LEN, "%i", i);
newname_len = IDENTIFIER_LENGTH (name)
+ strlen (numbuf) + 2;
@@ -10267,10 +10269,9 @@ tsubst_decl (tree t, tree args, tsubst_f
/* Get the Ith type. */
type = TREE_VEC_ELT (expanded_types, i);
- if (DECL_NAME (r))
- /* Rename the parameter to include the index. */
- DECL_NAME (r) =
- make_ith_pack_parameter_name (DECL_NAME (r), i);
+ /* Rename the parameter to include the index. */
+ DECL_NAME (r)
+ = make_ith_pack_parameter_name (DECL_NAME (r), i);
}
else if (!type)
/* We're dealing with a normal parameter. */
@@ -0,0 +1,22 @@
+// PR c++/55542
+// { dg-options "-std=c++11" }
+
+template <typename ... P>
+struct B
+{
+ template <typename O>
+ B (O *o, void (O::*f) (P ... p)) {}
+};
+class C
+{
+ void foo (void *, int);
+ template <typename ... A>
+ void bar (A ... a);
+ B <void *> c;
+ B <void *, int> d;
+ C (int) : c (this, &C::bar), d (this, &C::foo) {}
+};
+template <typename ... A>
+void C::bar (A ...)
+{
+}