You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
@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
Walter Bright (@WalterBright) reported this on 2019-04-02T20:32:57Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19785
CC List
Description
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.The text was updated successfully, but these errors were encountered: