re PR debug/39706 (namespaces represented incorrectly in debug_pubnames)

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: r150453
This commit is contained in:
Dodji Seketeli 2009-08-04 12:28:27 +00:00 committed by Dodji Seketeli
parent d1a8dfc009
commit e1e55b4816
4 changed files with 29 additions and 1 deletions

View 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-03 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>

View File

@ -2181,7 +2181,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);

View 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-03 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>

View File

@ -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; }