>From the C++ standard, 7.5p1:

Two function types with different language linkages are distinct types even if
they are otherwise identical.

The following code tests for this and should compile (a successful compile
indicates a test pass).

template <bool>
struct static_assert;

template<>
struct static_assert<true> {};

extern "C"
{
char myexit(void (*)(void));
typedef void (*CF)(void);
}

int myexit(void (*f)())
{
    static_assert<sizeof(myexit((CF)f)) == 1> e1;
    return myexit((CF)f);
}

int main()
{
}

extern "C"
{
char myexit(void (*)(void))
{
    return 0;
}
}


-- 
           Summary: Language linkage not part of function type
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hhinnant at apple dot com
  GCC host triplet: Darwin ppc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28308

Reply via email to