jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
552 stars 58 forks source link

Duplicated class if forward declared when using category directives #114

Open jmillan opened 8 years ago

jmillan commented 8 years ago

Hi,

The following code perfectly generates the documentation for the given classes

/* cldoc:begin-category(core::A) */
class A;
/* cldoc:end-category() */

/* cldoc:begin-category(core::A) */
class A {
  public:
  int a;
};
/* cldoc:end-category() */

Whereas removing the category directive around the forward declaration duplicates the A class on the documentation. It generates an A class object in the root space and another one in the core category.

This is not a bug. I would expect it to work as it does. I just want to ask whether I need to surround with these directives every forward declaration which canonical declaration is also 'categorized', or whether there's another way (less manual) to do it.

Any feedback is very appreciated.

jmillan commented 8 years ago

I can't think of any solution which does not imply surrounding the forward declarations with the (begin-category and end-category) directives, which I can't afford.

It's a pity, other than this I find the project very useful.