jessevdk / cldoc

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

Class template specializations displayed incorrectly. #109

Open cbiffle opened 9 years ago

cbiffle commented 9 years ago

Encountering several specializations (full or partial) of a class template mangles the documentation results for the template.

Found in b3fc442786b219746cf6487fc606ef1a77e94a90

Input

/*
 * Hello.
 */
template <typename T>
struct Unit {};

/*
 * Fully specialized.
 */
template <>
struct Unit<int> {};

/*
 * Fully specialized again.
 */
template <>
struct Unit<double> {};

/*
 * Partially specialized.
 */
template <typename T>
struct Unit<Unit<T>> {};

Expected Results

Unit is documented as a template. The availability of specializations is noted, since each specialization may have different members. Documenting them all on one page would be fine (as cppreference.com does) or on separate pages (as Doxygen seems to insist on doing).

The comments on each specialization are available where the specialization is documented.

Actual Results

In the top-level view, Unit appears three times, once as a template, and twice as a non-template: top-level hierarchy view

All three link to the same place, #Unit/Unit. It looks like this: view of the unit type itself

As you can see,

In case you're curious, if you add members to the specialization whose doc comment appears (Unit<double>) they appear in the docs. Members added to the base template or other specializations are dropped.