www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18385] New: [REG nightly] function cannot be overloaded with

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

          Issue ID: 18385
           Summary: [REG nightly] function cannot be overloaded with
                    another extern(C) function
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: doob me.com

The following code compiles with latest DMD 2.078.1, but fails with DMD nightly
v2.078.2-beta.1-651-gc55c9be60.

extern (C):

void foo(int) { }
void foo(double) { }

Note that global C function will not have a mangling, but methods of a struct
or class declared as `extern (C)` will get mangled as a D method. This can be
used as a callback function for a C function.

--
Feb 06