Bug 21400 – DDoc skips version else blocks inside templates

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-11-16T21:07:44Z
Last change time
2024-12-13T19:12:52Z
Keywords
ddoc
Assigned to
No Owner
Creator
Paul Backus
Moved to GitHub: dmd#19825 →

Comments

Comment #0 by snarwin+bugzilla — 2020-11-16T21:07:44Z
Example program: --- /// My cool struct struct S(T) { version (none) {} else /// My cool method void method() {} } --- As of DMD 2.094.0, the DDoc output of this program (compiled with `dmd -c -D`) contains documentation for S, but not for method.
Comment #1 by nick — 2022-10-09T16:57:27Z
Just a note that changing `none` to `all` still doesn't show `method`.
Comment #2 by snarwin+bugzilla — 2022-10-09T17:25:40Z
I think it's expected (or at least accepted as a known limitation) that DDoc will skip declarations that are excluded from compilation by `version` blocks. The bug here is specifically that it skips a declaration that is *included* in the compilation. (Note the `else` at the end of the line with the `version` condition.)
Comment #3 by robert.schadek — 2024-12-13T19:12:52Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19825 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB