From 9ef3dbcdae545afddada54c57ed3027388fe4b0f Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Mon, 12 Oct 2009 11:57:30 +0000 Subject: 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 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 11 +++-------- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/debug/dwarf2/template-params-7.C | 21 +++++++++++++++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81e7fda..73103c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-10-12 Dodji Seketeli + + 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 PR debug/41616 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a3f7ad2..a8d0048 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20d915f..36d90f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-10-12 Dodji Seketeli + + PR c++/41570 + * gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C: New test. + 2009-10-12 Alexandre Oliva PR debug/41616 diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C new file mode 100644 index 0000000..d021d96 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-params-7.C @@ -0,0 +1,21 @@ +// Contributed by Dodji Seketeli +// 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 +struct M +{ +}; + +struct R : + M<> +{ +}; + +R r; -- cgit v1.1