Issue 17378 - Allow multiple arguments for assert and static assert
Summary: Allow multiple arguments for assert and static assert
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Linux
: P4 enhancement
Assignee: No Owner
URL:
Keywords: pull
: 21715 (view as issue list)
Depends on:
Blocks:
 
Reported: 2017-05-07 09:19 UTC by Ali Cehreli
Modified: 2022-12-19 14:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ali Cehreli 2017-05-07 09:19:46 UTC
This is for consistency with pragma(msg) and developer and build efficiency (because std.string.format would not be needed anymore).

void main() {
    pragma(msg, "hi ", 42);
    // static assert(false, "wat ", 43);
    // assert(false, "why ", 44);
}

The commented-out lines should be compilable and output "wat 43" and "why 44" respectively.

Ali
Comment 1 RazvanN 2021-03-16 08:14:52 UTC
*** Issue 21715 has been marked as a duplicate of this issue. ***
Comment 2 Dlang Bot 2022-11-02 13:42:01 UTC
@ntrel created dlang/dmd pull request #14611 "Allow multiple message arguments for static assert" fixing this issue:

- Fix Issue 17378 - Allow multiple message arguments for static assert
  
  Rebase #11757.
  
  initial implementation
  
  ws
  
  ws
  
  fix compileable1 test case
  
  fix
  
  update frontend.h
  
  fix astbase
  
  take two

https://github.com/dlang/dmd/pull/14611
Comment 3 Dlang Bot 2022-12-19 14:06:55 UTC
dlang/dmd pull request #14611 "Allow multiple message arguments for static assert" was merged into master:

- 1f9bc7d78aa34e2c6fbd84901d6558829d3e1127 by Nicholas Wilson:
  Fix Issue 17378 - Allow multiple message arguments for static assert
  
  Rebase #11757.
  
  initial implementation
  
  ws
  
  ws
  
  fix compileable1 test case
  
  fix
  
  update frontend.h
  
  fix astbase
  
  take two

https://github.com/dlang/dmd/pull/14611