+2009-10-12 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/41570
+ * gcc/dwarf2out.c (template_parameter_pack_die,
+ gen_formal_parameter_pack_die): Use add_name_and_src_coords_attributes.
+
2009-10-12 Alexandre Oliva <aoliva@redhat.com>
PR debug/41616
dw_die_ref die;
int j;
- gcc_assert (parent_die
- && parm_pack
- && DECL_NAME (parm_pack));
+ gcc_assert (parent_die && parm_pack);
die = new_die (DW_TAG_GNU_template_parameter_pack, parent_die, parm_pack);
- add_AT_string (die, DW_AT_name, IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
-
+ add_name_and_src_coords_attributes (die, parm_pack);
for (j = 0; j < TREE_VEC_LENGTH (parm_pack_args); j++)
generic_parameter_die (parm_pack,
TREE_VEC_ELT (parm_pack_args, j),
gcc_assert (parm_pack
&& lang_hooks.function_parameter_pack_p (parm_pack)
- && DECL_NAME (parm_pack)
&& subr_die);
parm_pack_die = new_die (DW_TAG_GNU_formal_parameter_pack, subr_die, parm_pack);
- add_AT_string (parm_pack_die, DW_AT_name,
- IDENTIFIER_POINTER (DECL_NAME (parm_pack)));
+ add_src_coords_attributes (parm_pack_die, parm_pack);
for (arg = pack_arg; arg; arg = TREE_CHAIN (arg))
{
--- /dev/null
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR debug/30161
+// { dg-options "-std=c++0x -g -dA -fno-merge-debug-strings" }
+
+// The type M<> should have one DW_TAG_GNU_template_parameter_pack DIE,
+// with no DW_AT_name attribute. We don't test the fact that it has no
+// DW_AT_name though.
+// { dg-final { scan-assembler-times "DIE \\(0x.*?\\) DW_TAG_GNU_template_parameter_pack" 1 } }
+
+
+template <typename...>
+struct M
+{
+};
+
+struct R :
+ M<>
+{
+};
+
+R r;