||Explicit import of C++ anonymous namespace
Section 3.2.2, pg 50
(Page 50 of DWARF 4; page 68 in dwarf5.20151019.pdf.)
The C++ standard says that declarations in the "anonymous
namespace" are implicitly available in the containing scope,
as if the namespace had a made-up unique name and the containing
scope had a "using" directive with that name.
This breaks the standard scoping that DWARF assumes about all
languages. While some consumers will notice that the language
for the compilation unit is C++, and may implicitly make
declarations within the anonymous namespace visible outside
the namespace, DWARF should not assume that ALL consumers will
do this. DWARF should recommend that producers emit explicit
syntax to describe the language-specific scoping behavior.
Section 3.2.2 has a non-normative paragraph that discusses
the anonymous namespace, which reads as follows:
"The C++ compilation unit specific "unnamed namespace" may be
represented by a namespace entry with no name attribute in the
original namespace declaration entry (and therefore no name
attribute in any namespace extension entry of this namespace)."
I propose adding to the paragraph as follows:
"C++ states that declarations in the unnamed namespace are
implicitly available in the containing scope; a producer
should make this effect explicit with the DW_AT_export_symbols
attribute, or by using a DW_TAG_imported_module that is a
sibling of the namespace entry and references it."
06/21/2016 -- Accepted.