[Issue 18385] [REG nightly] function cannot be overloaded with another extern(C) function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 23 10:42:27 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18385

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |code at dawg.eu
         Resolution|INVALID                     |---

--- Comment #4 from Martin Nowak <code at dawg.eu> ---
(In reply to Walter Bright from comment #2)
> Yes, it should never have compiled, and it cannot work, as two functions
> with the same mangled name cannot both exist in the executable.

Not so fast, the report about methods being broken is still somewhat valid.
In that case `extern(C)` only affects the calling convention but not the
mangling, and has mentioned use-cases as callbacks.
It's relatively easy to just use different names for that use-case, so we might
decide to deprecate this overloading if that seems necessary.

--


More information about the Digitalmars-d-bugs mailing list