Bug 4107 – Duplicate documentation for member function templates

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-04-21T02:27:00Z
Last change time
2014-02-15T02:43:06Z
Keywords
ddoc, patch
Assigned to
nobody
Creator
bugzilla

Attachments

IDFilenameSummaryContent-TypeSize
611bug4107.htmlDDoc outputtext/html670

Comments

Comment #0 by bugzilla — 2010-04-21T02:27:12Z
Created attachment 611 DDoc output When a templated class/struct contains a member function template, the documentation for the latter is printed twice in the resulting HTML file; once for the template and once for the function. /// struct doc struct Bug4107(T) { /// templated function doc void foo(U)(U u) { } } I've attached the HTML file generated by DDoc.
Comment #1 by kennytm — 2011-06-04T11:45:40Z
The bug is that, DMD only recognizes the "a template declares exactly one member, and that member is a function with the same name as the template" (is there are short-form for that?) during semantic(), but the template isn't instantiated, so its members won't be semantic()-ed. Therefore, does not know that 'foo' is a "magic one-member template", and emits the ddoc comment as if it's a regular template. A related bug is when there are nested templated aggregates, the inner levels won't be shown in DDoc. ---------------------------------- /// alpha struct Bug4107b(T) { /// beta public struct B(U) { /// gamma public struct C(V) { /// delta public struct D(W) { } } } } ----------------------------------
Comment #2 by kennytm — 2011-06-04T12:54:48Z
Comment #3 by bugzilla — 2011-06-06T00:19:29Z