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

          Issue ID: 15217
           Summary: overloaded extern(C) function declarations are allowed
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: k.hara...@gmail.com
            Blocks: 14147

Simple test case:

extern (C) void foo(void function() fp);
extern (C) void foo(void function() @nogc fp) @nogc;


This is included in issue 14147, but it's actually used in current druntime
code to ignore attribute differences.

----

extern (C):

private alias void function(int) sigfn_t;

nothrow @nogc
{
    private alias void function(int) sigfn_t2;
}

version (CRuntime_Glibc)
{
    sigfn_t bsd_signal(int sig, sigfn_t func);

  nothrow:
  @nogc:
    sigfn_t2 bsd_signal(int sig, sigfn_t2 func);
}

----

The extern (C) bsd_signal function is overloaded but they refers same link
symbol '_bsd_signal'.

--

Reply via email to