2609 – No documentation generated for destructor

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2609 - No documentation generated for destructor
Summary: No documentation generated for destructor
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 enhancement
Assignee: No Owner
URL:
Keywords: ddoc, patch
Depends on:
Blocks:
Reported: 2009年01月23日 20:23 UTC by Andrei Alexandrescu
Modified: 2014年02月14日 20:35 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Andrei Alexandrescu 2009年01月23日 20:23:23 UTC
No documentation is generated for destructors:
/// Yah
struct S
{
 /// Nah
 ~this() {}
}
Yah appears, Nah doesn't.
Comment 1 Andrei Alexandrescu 2009年01月23日 20:29:58 UTC
I also add that documentation is not generated for copy constructors, i.e. this(this).
Comment 2 Don 2010年03月12日 14:06:54 UTC
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 Walter Bright 2010年03月29日 11:38:07 UTC
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 Don 2010年03月29日 13:08:33 UTC
(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
Comment 5 Don 2010年04月09日 19:10:22 UTC
Fixed DMD1.058 and DMD2.043.


AltStyle によって変換されたページ (->オリジナル) /