D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22896 - importC: 'function redeclaration with different type' should ignore const
Summary: importC: 'function redeclaration with different type' should ignore const
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: ImportC, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2022-03-18 04:58 UTC by duser
Modified: 2022-03-20 06:19 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 duser 2022-03-18 04:58:41 UTC
void fn(int);
void fn(const int x)
{
}

Error: function `fn` redeclaration with different type

gcc and clang allow this without warnings
Comment 1 Dlang Bot 2022-03-19 23:52:12 UTC
@WalterBright created dlang/dmd pull request #13845 "fix Issue 22896 - importC: 'function redeclaration with different typ…" fixing this issue:

- fix Issue 22896 - importC: 'function redeclaration with different type' should ignore const

https://github.com/dlang/dmd/pull/13845
Comment 2 Dlang Bot 2022-03-20 06:19:44 UTC
dlang/dmd pull request #13845 "fix Issue 22896 - importC: 'function redeclaration with different typ…" was merged into master:

- 030aa6f86d1593407e567fe2529738d2d86a5f0d by Walter Bright:
  fix Issue 22896 - importC: 'function redeclaration with different type' should ignore const

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