From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18940 invoked by alias); 8 Mar 2014 08:16:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18851 invoked by uid 48); 8 Mar 2014 08:16:26 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/2316] g++ fails to overload on language linkage Date: Sat, 08 Mar 2014 08:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 2.97 X-Bugzilla-Keywords: ABI, accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00647.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #52 from Marc Glisse --- (In reply to Harald van Dijk from comment #51) > Note that a consequence of this is that a function declaration that uses a > typedef may not be compatible with the typedef (I think): > > extern "C" { void f(); } > typedef void t(); > t f, *g = f; // valid redeclaration of f, invalid initialisation of g Fun! > extern "C" t f; // invalid redeclaration of f I am not 100% sure about that one. > Linkage conflicts with built-in declarations of functions are also a bit of > a problem: Yes, as I said in comment #38 and comment #39, giving builtin functions the right linkage is a big missing part of the patch. > implementing this as described makes GCC fail to compile, At least in the version of the patch that is attached to the PR, gcc tries to accept almost anything except in some pedantic mode. The goal is to avoid breaking every code on earth, or the patch has no chance of ever being accepted. > (I may well continue working on this, but if I do, I will only do so > occasionally and will likely not be able to send anything meaningful or > useful for a long time.) Good luck!