This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/2316] g++ fails to overload on language linkage
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2005 21:34:36 -0000
- Subject: [Bug c++/2316] g++ fails to overload on language linkage
- References: <20010318174600.2316.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sebor at roguewave dot com 2005-09-11 21:34 -------
In reply to comment #6:
The vanilla EDG eccp 3.5 compiles the test case w/o an error:
$ eccp -v t.cpp && ./a.out; echo $?
Edison Design Group C/C++ Front End, version 3.5 (Nov 9 2004 20:00:33)
Copyright 1988-2004 Edison Design Group, Inc.
0
Intel C++ 9.0 (based on eccp 3.4.1) does reject the code, but that's most likely
for compatibility with gcc. I wouldn't rely on its behavior to determine whether
gcc is or isn't correct. (Note that HP aCC 6.0 which is also based on EDG eccp
accepts the code as expected.)
In reply to comment #4:
I don't think DR 4 is related since it's about internal linkage.
The test case is well-formed according to 7.5.1, p1, "Two function types with
different language linkages are distinct types even if they are otherwise
identical."
I.e., the first foo() can only take the address of an extern "C" function as an
argument (and not extern "C++") while the second foo() only an extern "C++"
function (and not extern "C"). Thus, each foo() is a distinct overload.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316