OSDN Git Service

2011-01-12 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jan 2011 17:02:41 +0000 (17:02 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jan 2011 17:02:41 +0000 (17:02 +0000)
PR debug/47209
* dwarfout2.c (should_emit_struct_debug): Use TYPE_MAIN_VARIANT
of type.

2011-01-12  Kai Tietz  <kai.tietz@onevision.com>

PR debug/47209
* g++.dg/debug/pr47209.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168718 138bc75d-0d04-0410-961f-82ee72b054a4

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

index db57dfd..78420e0 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-12  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR debug/47209
+       * dwarfout2.c (should_emit_struct_debug): Use TYPE_MAIN_VARIANT
+       of type.
+
 2011-01-12  Jan Hubicka  <jh@suse.cz>
 
        PR driver/47244
index 4e9ce91..7e64b37 100644 (file)
@@ -619,7 +619,7 @@ should_emit_struct_debug (tree type, enum debug_info_usage usage)
   if (criterion == DINFO_STRUCT_FILE_ANY)
     return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
 
-  type_decl = TYPE_STUB_DECL (type);
+  type_decl = TYPE_STUB_DECL (TYPE_MAIN_VARIANT (type));
 
   if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl))
     return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
index 451d643..f7ab937 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-12  Kai Tietz  <kai.tietz@onevision.com>
+
+       PR debug/47209
+       * g++.dg/debug/pr47209.C: New.
+
 2011-01-12  Richard Guenther  <rguenther@suse.de>
 
        PR lto/47259
diff --git a/gcc/testsuite/g++.dg/debug/pr47209.C b/gcc/testsuite/g++.dg/debug/pr47209.C
new file mode 100644 (file)
index 0000000..c144c16
--- /dev/null
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-femit-struct-debug-baseonly" }
+struct A
+{
+  void foo ();
+};
+
+struct B : A
+{
+  typedef const A base;
+  using base::foo;
+};