Commit 9ef3dbcd by Dodji Seketeli Committed by Dodji Seketeli

Candidate fix for PR c++/41570

gcc/ChangeLog:
	PR c++/41570
	* gcc/dwarf2out.c (template_parameter_pack_die,
	gen_formal_parameter_pack_die): Use add_name_and_src_coords_attributes.

gcc/testsuite/ChangeLog:
	PR c++/41570
	* gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C: New test.

From-SVN: r152663
parent 3a56edc7
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
......@@ -12353,13 +12353,10 @@ template_parameter_pack_die (tree parm_pack,
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),
......@@ -17207,12 +17204,10 @@ gen_formal_parameter_pack_die (tree parm_pack,
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))
{
......
2009-10-12 Dodji Seketeli <dodji@redhat.com>
PR c++/41570
* gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C: New test.
2009-10-12 Alexandre Oliva <aoliva@redhat.com>
PR debug/41616
......
// 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;
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