public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28308]  New: Language linkage not part of function type
@ 2006-07-07 19:28 hhinnant at apple dot com
  2006-07-07 20:53 ` [Bug c++/28308] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: hhinnant at apple dot com @ 2006-07-07 19:28 UTC (permalink / raw)
  To: gcc-bugs

>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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/28308] Language linkage not part of function type
  2006-07-07 19:28 [Bug c++/28308] New: Language linkage not part of function type hhinnant at apple dot com
@ 2006-07-07 20:53 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-07 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-07 20:52 -------


*** This bug has been marked as a duplicate of 2316 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-07 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07 19:28 [Bug c++/28308] New: Language linkage not part of function type hhinnant at apple dot com
2006-07-07 20:53 ` [Bug c++/28308] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).