The following:
alias V = void;
pragma(msg, V);
should print:
void
And it does when the pragma is inside a function! But when it as global level, it prints:
Error: Cannot pass argument void to pragma msg because it is void
This problem was introduced in https://github.com/dlang/dmd/pull/7316 as a fix for https://issues.dlang.org/show_bug.cgi?id=17382. Unfortunately, it altered the code for PragmaDeclaration but not PragmaStatement, hence the difference. But the 17382 bug remains.
Essentially, 7316 was not a correct fix for 17382.
Comment #1 by dlang-bot — 2021-02-19T10:21:40Z
@WalterBright updated dlang/dmd pull request #12211 "fix Issue 21647 - pragma(msg) should be able to print a void type" fixing this issue:
- fix Issue 21647 - pragma(msg) should be able to print a void type
https://github.com/dlang/dmd/pull/12211
Comment #2 by dlang-bot — 2021-02-22T23:59:31Z
dlang/dmd pull request #12211 "fix Issue 21647 - pragma(msg) should be able to print a void type" was merged into master:
- c867a41f72a6be4ba50a39d3739a3414d8fb8cb5 by Walter Bright:
fix Issue 21647 - pragma(msg) should be able to print a void type
https://github.com/dlang/dmd/pull/12211
Comment #3 by dlang-bot — 2021-04-02T05:45:33Z
dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" was merged into dmd-cxx:
- 956760d88ea4ec6329dfb0b9e15b90544106ced8 by Iain Buclaw:
[dmd-cxx] fix Issue 21647 - pragma(msg) should be able to print a void type
https://github.com/dlang/dmd/pull/12339