This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] PR c++/41570


On Sun, Oct 11, 2009 at 06:09:30PM -0400, Jason Merrill wrote:
> Let's just use add_name_and_src_coords_attributes like we do for other  
> decls, both here and in gen_formal_parameter_pack_die; they don't need  
> to have names either.

OK, done below.

-- 
Dodji Seketeli
Red Hat


commit c66a3513ff3c99c9251d5d0b1e407a2a40ad5a83
Author: Dodji Seketeli <dodji@redhat.com>
Date:   Sun Oct 11 22:57:46 2009 +0200

    Candidate fix for PR c++/41570
    
    gcc/ChangeLog:
    	PR c++/41570
    	* gcc/dwarf2out.c (template_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.

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f9304e5..ab2d1f2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12177,13 +12177,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),
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 <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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]