Bug 19785 – top level const types in function parameters should not mangle as const

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-04-02T20:32:57Z
Last change time
2024-12-13T19:02:49Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#19550 →

Comments

Comment #0 by bugzilla — 2019-04-02T20:32:57Z
void foo(const int i) { } void bar(int i) { } Mangles as: _D4test3fooFxiZv _D4test3barFiZv The 'x' is not necessary in the mangling for foo(), as the const would only apply to the internal behavior of foo(), and is not relevant to the caller.
Comment #1 by ag0aep6g — 2019-04-02T21:16:09Z
I suppose these should also mangle the same then: void foo(const int* p) {} void bar(const(int)* p) {} And these, too: void foo(const int[] p) {} void bar(const(int)[] p) {} I.e., remove the top level of const for mangling.
Comment #2 by dlang-bot — 2019-04-04T08:27:35Z
@WalterBright created dlang/dmd pull request #9556 "fix Issue 19785 - top level const types in function parameters should…" fixing this issue: - fix Issue 19785 - top level const types in function parameters should not mangle as const https://github.com/dlang/dmd/pull/9556
Comment #3 by bugzilla — 2019-04-04T08:28:27Z
(In reply to ag0aep6g from comment #1) > I suppose these should also mangle the same then: Yes.
Comment #4 by robert.schadek — 2024-12-13T19:02:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19550 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB