Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

top level const types in function parameters should not mangle as const #19550

Open
dlangBugzillaToGithub opened this issue Apr 2, 2019 · 3 comments

Comments

@dlangBugzillaToGithub
Copy link

Walter Bright (@WalterBright) reported this on 2019-04-02T20:32:57Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=19785

CC List

  • ag0aep6g

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.
@dlangBugzillaToGithub
Copy link
Author

ag0aep6g commented on 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.

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 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

@dlangBugzillaToGithub
Copy link
Author

bugzilla (@WalterBright) commented on 2019-04-04T08:28:27Z

(In reply to ag0aep6g from comment #1)
> I suppose these should also mangle the same then:

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant