Anonymous namespace within another namespace will duplicate top-level namespace
Environment
version and/or commit hash:
0.13.4
Describe the bug
Placing an anonymous namespace within another namespace will duplicate top-level namespace:
a.cxx:
namespace hello
{
namespace
{
void
say_hello (ostream& o, const string& n)
{
if (n.empty ())
throw invalid_argument ("empty name");
o << "Hello, " << n << '!' << endl;
}
}
}
b.cxx:
namespace hello
{
namespace
{
void
say_hello (ostream& o, const string& n)
{
if (n.empty ())
throw invalid_argument ("empty name");
o << "Hello, " << n << '!' << endl;
}
}
}
Additional information
It also becomes confused and duplicates elements, such as concept from a.cxx, within both namespaces.
Additional context from discord:
This is specific to XML output, e.g. Doxygen HTML is fine in that regards.
Thinking about this, I don't actually this is worth addressing, tbh. Anonymous namespaces are for implementation details in cpp files - running Doxygen over cpp files (i.e. not headers, but actual implementation source files) is unusual. A better fix for this would be simply to not run doxygen/poxy over cpp files at all
Thinking about this, I don't actually this is worth addressing, tbh. Anonymous namespaces are for implementation details in cpp files - running Doxygen over cpp files (i.e. not headers, but actual implementation source files) is unusual. A better fix for this would be simply to not run doxygen/poxy over cpp files at all
Agree - Note that it was a long time ago, so I don't remember the context, but that may have been from playing with modules here (where the extension name is arbitrary with some build system)
Closing :)