cldoc icon indicating copy to clipboard operation
cldoc copied to clipboard

Class template specializations displayed incorrectly.

Open cbiffle opened this issue 10 years ago • 0 comments

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,

  • It isn't presented as a template at all.
  • The presence of full and partial specializations is not indicated (which I suppose makes sense, if it isn't a template).
  • It has the doc comment from the second full specialization only -- the others appear to have been lost.

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.

cbiffle avatar Jul 13 '15 18:07 cbiffle