------- Comment #5 from dodji at gcc dot gnu dot org 2009-03-17 07:59 -------
Subject: Re: DW_TAG_imported_module should be used (not
DW_TAG_imported_declaration)
jakub at gcc dot gnu dot org a écrit :
> So this patch instead? C++ will never need non-NULL DECL_NAME on
> IMPORTED_DECL,
> as it doesn't have the ability to rename imports like Fortran does.
Hmmh, I think the non null name there is useful for namespace aliases in
C++, e.g.
namespace A {
int foo;
}
void
f ()
{
namespace B = A;
}
That namespace alias will be represented by a
DW_TAG_imported_declaration which DW_AT_name set to "B" and which
DW_AT_import is set to a reference to namespace A.
FWIW, the DWARF3 spec says at 3.2.3:
"A C++ namespace alias may be represented by an imported declaration
entry with a name attribute whose value is a null-terminated string
containing the alias name as it appears in the source program and an
import attribute whose value is a reference to the applicable original
namespace or namespace extension entry."
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39471