marzer / poxy

Documentation generator for C++
https://pypi.org/project/poxy
MIT License
135 stars 5 forks source link

Anonymous namespace within another namespace will duplicate top-level namespace #28

Open wroyca opened 11 months ago

wroyca commented 11 months ago

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

image

Additional information

It also becomes confused and duplicates elements, such as concept from a.cxx, within both namespaces.

image

wroyca commented 11 months ago

Additional context from discord:

This is specific to XML output, e.g. Doxygen HTML is fine in that regards.