D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21647 - pragma(msg) should be able to print a void type
Summary: pragma(msg) should be able to print a void type
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-02-19 09:39 UTC by Walter Bright
Modified: 2021-04-02 05:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2021-02-19 09:39:00 UTC
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 Dlang Bot 2021-02-19 10:21:40 UTC
@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 Dlang Bot 2021-02-22 23:59:31 UTC
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 Dlang Bot 2021-04-02 05:45:33 UTC
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