Bug 2609 – No documentation generated for destructor
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-01-23T20:23:00Z
Last change time
2014-02-14T20:35:48Z
Keywords
ddoc, patch
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2009-01-23T20:23:23Z
No documentation is generated for destructors:
/// Yah
struct S
{
/// Nah
~this() {}
}
Yah appears, Nah doesn't.
Comment #1 by andrei — 2009-01-23T20:29:58Z
I also add that documentation is not generated for copy constructors, i.e. this(this).
Comment #2 by clugdbug — 2010-03-12T14:06:54Z
This is a bit bizarre. In doc.c, around line 450, there's a lot of empty functions:
void Dsymbol::emitComment(Scope *sc) { }
void InvariantDeclaration::emitComment(Scope *sc) { }
#if DMDV2
void PostBlitDeclaration::emitComment(Scope *sc) { }
#endif
void DtorDeclaration::emitComment(Scope *sc) { }
void StaticCtorDeclaration::emitComment(Scope *sc) { }
void StaticDtorDeclaration::emitComment(Scope *sc) { }
void ClassInfoDeclaration::emitComment(Scope *sc) { }
void ModuleInfoDeclaration::emitComment(Scope *sc) { }
void TypeInfoDeclaration::emitComment(Scope *sc) { }
I believe that all of these should be deleted. Deleting PostBlit and Dtor certainly fixes the bugs in this report. FuncDeclaration::emitComment() seems to handle them just fine.
Comment #3 by bugzilla — 2010-03-29T11:38:07Z
The documentation for those functions should not be part of their interface presented to the user. That's why doc isn't generated for them.
It was a deliberate choice, not a bug. I'll mark it as an enhancement request.
Comment #4 by clugdbug — 2010-03-29T13:08:33Z
(In reply to comment #3)
> The documentation for those functions should not be part of their interface
> presented to the user. That's why doc isn't generated for them.
>
> It was a deliberate choice, not a bug. I'll mark it as an enhancement request.
I think that's a reasonable decision, but the spec should state that doc isn't generated for them.
Eg, after:
If there is no documentation comment for a declaration, that declaration may not appear in the output. To ensure it does appear in the output, put an empty declaration comment for it.
+ Declarations which are not an explicit part of the interface do not have documentation generated for them. These include:
+ invariant
+ postblit
+ destructor
+ static constructors and destructors
+ class info, type info, and module info