* dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration
nodes.
* g++.dg/debug/dwarf2/imported-decl-1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145018
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-03-24 Dodji Seketeli <dodji@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39524
+ * dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration
+ nodes.
+
2009-03-23 Jakub Jelinek <jakub@redhat.com>
PR c/39495
return;
}
+ /* If the compiler emitted a definition for the DECL declaration
+ and if we already emitted a DIE for it, don't emit a second
+ DIE for it again. */
+ if (old_die
+ && declaration
+ && old_die->die_parent == context_die)
+ return;
+
var_die = new_die (DW_TAG_variable, context_die, decl);
origin_die = NULL;
+2009-03-24 Dodji Seketeli <dodji@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39524
+ * g++.dg/debug/dwarf2/imported-decl-1.C: New test.
+
2009-03-23 Jakub Jelinek <jakub@redhat.com>
PR c/39495
--- /dev/null
+// PR debug/39524
+// { dg-do compile }
+// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" }
+
+namespace A
+{
+ static int var2 = 2;
+}
+
+int
+func ()
+{
+ using A::var2;
+ return var2;
+}
+
+// { dg-final { scan-assembler-times "var2\[^\n\r\]*DW_AT_name" 1 } }