From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30998 invoked by alias); 20 Dec 2012 19:37:15 -0000 Received: (qmail 28616 invoked by uid 48); 20 Dec 2012 19:36:54 -0000 From: "tmsriram at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55742] __attribute__ in class function declaration cause "prototype does not match" errors. Date: Thu, 20 Dec 2012 19:37: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tmsriram at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-12/txt/msg02045.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742 --- Comment #5 from Sriraman Tallam 2012-12-20 19:36:53 UTC --- (In reply to comment #4) > On Thu, Dec 20, 2012 at 1:21 PM, tmsriram at google dot com > wrote: > > > However, with function multiversioning, this will become a problem as > > multiversioning does not treat two decls with different target attributes > > as > > identical. Since we are enabling multiversioning by default, atleast in > > C++ > > front-end for now, IMO, it is better to insist that the definition and > > declaration contain identical target attributes. > > Unfortunately, we cannot do that. A lot of existing code relies on > this attribute merging. The cleanest approach here is probably to add > an additional 'mv' attribute to explicitly enable multiversioning. > Breaking the existing semantics is going to break a lot of code. Ok, just to be clear, there are two problems here: 1) Target attribute merging. If the assumption that the target attributes of the decls must be merged is valid, there is a bug. Also, this means that using target attributes to do multiversioning is wrong. 2) Function multiversioning is exposing the bug, via build failures, the problem of declarations and definitions not having identical target attributes. First, we need to decide if target attribute merging is a valid assumption. If so, we fix the bug and make function multiversioning use a new attribute. If the assumption is not valid, changing the source is the only solution. The source is invalid now since the intended behaviour is not happening. > > > Diego.