This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] fix 24824
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Jan 2006 16:01:30 +0000
- Subject: [C++ PATCH] fix 24824
I've installed this patch to fix a dwarf2 eliminate dups breakage I caused.
I'd made a mistake in my using decl cleanup patch, and then got confused about
how dwarf2 placed struct definitions in the global namespace but the declaration
in the actual namespace of the struct. All became clear when I traced execution
to the following comment in dwarf2out.c
For compatibility with older debuggers, namespace DIEs only contain
declarations; all definitions are emitted at CU scope. */
built & tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2006-01-12 Nathan Sidwell <nathan@codesourcery.com>
PR c++/24824
* class.c (handle_using_decl): Pass correct scope to
cp_emit_debug_info_for_using.
PR c++/24824
* g++.dg/debug/dwarf2-1.C: New.
Index: cp/class.c
===================================================================
--- cp/class.c (revision 109642)
+++ cp/class.c (working copy)
@@ -1159,7 +1159,7 @@ handle_using_decl (tree using_decl, tree
old_value = NULL_TREE;
}
- cp_emit_debug_info_for_using (decl, current_class_type);
+ cp_emit_debug_info_for_using (decl, USING_DECL_SCOPE (using_decl));
if (is_overloaded_fn (decl))
flist = decl;
Index: testsuite/g++.dg/debug/dwarf2-1.C
===================================================================
--- testsuite/g++.dg/debug/dwarf2-1.C (revision 0)
+++ testsuite/g++.dg/debug/dwarf2-1.C (revision 0)
@@ -0,0 +1,22 @@
+// Copyright (C) 2006 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Jan 2006 <nathan@codesourcery.com>
+
+// PR 24824
+// Origin: wanderer@rsu.ru
+
+// { dg-options "-feliminate-dwarf2-dups" }
+
+namespace N
+{
+ struct Base
+ {
+ int m;
+ };
+
+ struct Derived : Base
+ {
+ using Base::m;
+ };
+}
+
+N::Derived thing;