www.digitalmars.com         C & C++   DMDScript  

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


          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

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 2018