re PR debug/27057 (ICE with -feliminate-dwarf2-dups and using namespace)
authorJakub Jelinek <jakub@redhat.com>
Mon, 10 Apr 2006 13:18:19 +0000 (15:18 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 10 Apr 2006 13:18:19 +0000 (15:18 +0200)
PR debug/27057
* dwarf2out.c (is_symbol_die): Return true also for namespaces.

* g++.dg/debug/dwarf2-2.C: New test.

From-SVN: r112820

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2-2.C [new file with mode: 0644]

index d21a6db..248e539 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/27057
+       * dwarf2out.c (is_symbol_die): Return true also for namespaces.
+
 2006-04-09  Roger Sayle  <roger@eyesopen.com>
 
        * expr.c (store_constructor): Don't bother clearing target if
index e400eb3..bfcc68f 100644 (file)
@@ -6263,7 +6263,8 @@ is_symbol_die (dw_die_ref c)
 {
   return (is_type_die (c)
          || (get_AT (c, DW_AT_declaration)
-             && !get_AT (c, DW_AT_specification)));
+             && !get_AT (c, DW_AT_specification))
+         || c->die_tag == DW_TAG_namespace);
 }
 
 static char *
index 41ba91e..becca44 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/27057
+       * g++.dg/debug/dwarf2-2.C: New test.
+
 2006-04-09  Richard Sandiford  <richard@codesourcery.com>
 
        PR rtl-optimization/27073
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2-2.C b/gcc/testsuite/g++.dg/debug/dwarf2-2.C
new file mode 100644 (file)
index 0000000..9e6dbd2
--- /dev/null
@@ -0,0 +1,17 @@
+// PR debug/27057
+// { dg-do compile }
+// { dg-options "-g -feliminate-dwarf2-dups" }
+
+namespace N
+{
+}
+
+struct A
+{
+  void foo ();
+};
+
+void A::foo ()
+{
+  using namespace N;
+}