]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/39706 (namespaces represented incorrectly in debug_pubnames)
authorDodji Seketeli <dodji@redhat.com>
Tue, 4 Aug 2009 16:59:11 +0000 (16:59 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Tue, 4 Aug 2009 16:59:11 +0000 (18:59 +0200)
2009-08-04  Dodji Seketeli  <dodji@redhat.com>

gcc/cp/ChangeLog:
PR debug/39706
* error.c (lang_decl_name): Print qualified names for decls
in  namespace scope.

gcc/testsuite/ChangeLog:
PR debug/39706
* g++.dg/debug/dwarf2/pubnames-1.C: New test.

From-SVN: r150462

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C [new file with mode: 0644]

index 688f6b8b7f052841d81e188ac4e9c793eaa44cae..bdb69b238ba8913555707a4d49c1fd371ab549f4 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-04  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/39706
+       * error.c (lang_decl_name): Print qualified names for decls
+       in  namespace scope.
+
 2009-08-04  Release Manager
 
        * GCC 4.3.4 released.
index 700a1127426da621201686634e74045d0a733f49..8b53257425f47985e4601009c0d3b9eeeb833c06 100644 (file)
@@ -2195,7 +2195,10 @@ lang_decl_name (tree decl, int v)
     return decl_as_string (decl, TFF_DECL_SPECIFIERS);
 
   reinit_cxx_pp ();
-  if (v == 1 && DECL_CLASS_SCOPE_P (decl))
+  if (v == 1
+      && (DECL_CLASS_SCOPE_P (decl)
+         || (DECL_NAMESPACE_SCOPE_P (decl)
+             && CP_DECL_CONTEXT (decl) != global_namespace)))
     {
       dump_type (CP_DECL_CONTEXT (decl), TFF_PLAIN_IDENTIFIER);
       pp_cxx_colon_colon (cxx_pp);
index ccc8a38b519185bdaf9aefd1978e53ab4b9bae8d..a8543d14776fecc98f6a580438d28e334e541852 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-04  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/39706
+       * g++.dg/debug/dwarf2/pubnames-1.C: New test.
+
 2009-08-04  Release Manager
 
        * GCC 4.3.4 released.
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/pubnames-1.C
new file mode 100644 (file)
index 0000000..f5089ca
--- /dev/null
@@ -0,0 +1,14 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR debug/39706
+// { dg-options "-g -dA" }
+// { dg-do compile }
+// { dg-final { scan-assembler-times ".debug_pubnames" 1 } }
+// { dg-final { scan-assembler-times "\"main\".*external name" 1 } }
+// { dg-final { scan-assembler-times "\"ns::ns_x.*external name" 1 } }
+// { dg-final { scan-assembler-times "\"y::y_x.*external name" 1 } }
+
+namespace ns { int ns_x; }
+class y { public: static int y_x; };
+int y::y_x;
+int main() { return ns::ns_x; }
+