From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15685 invoked by alias); 16 Jan 2013 20:04:23 -0000 Received: (qmail 15592 invoked by uid 48); 16 Jan 2013 20:03:47 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55742] [4.8 regression] __attribute__ in class function declaration cause "prototype does not match" errors. Date: Wed, 16 Jan 2013 20:04: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: jason at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 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: 2013-01/txt/msg01568.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742 --- Comment #29 from Jason Merrill 2013-01-16 20:03:42 UTC --- (In reply to comment #25) > Anyway, with target("any") attribute, what would happen for > void foo () __attribute__((target ("avx"))); > void foo () __attribute__((target ("any"))); > void foo () {} > Is the definition "any", something else? The definition is an error, because it's ambiguous which version it's defining. (In reply to comment #28) > Further, if we have these three declarations in this order: > > void foo () __attribute__((target ("avx"))); > void foo () __attribute__((target ("sse4.2"))); > void foo () __attribute__((target ("any"))); > > This seems to mean that we want foo to be multi-versioned. However, when the > front-end is processing the second declaration, how would it decide between > merging or not without seeing the third? It would always declare a separate version. 4.7 doesn't actually merge target attributes, a later declaration just replaces the earlier target attribute; this seems like useless behavior to me that could be replaced with multiversioning semantics.