From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26574 invoked by alias); 17 Jan 2013 22:45:48 -0000 Received: (qmail 26499 invoked by uid 48); 17 Jan 2013 22:45:28 -0000 From: "xinliangli at gmail dot com" 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: Thu, 17 Jan 2013 22:45: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: xinliangli at gmail dot com 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/msg01669.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742 --- Comment #30 from davidxl 2013-01-17 22:45:22 UTC --- (In reply to comment #26) > On Wed, Jan 16, 2013 at 5:02 PM, jakub at gcc dot gnu.org > wrote: > > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742 > > > > --- Comment #25 from Jakub Jelinek 2013-01-16 16:02:35 UTC --- > > The actual merging of target attribute isn't that important, what would be more > > important is that other attributes are merged together in that case and the > > decls treated as the same thing. > > > > Anyway, with target("any") attribute, what would happen for > > void foo () __attribute__((target ("avx"))); > > void foo () __attribute__((target ("any"))); > > IMHO the re-declaration with a different target attribute should be an error. This can be a clean way to handle declarations. The definition should have either 'default' attribute or a matching target attribute. > A proper "forward" declaration for a function with MV applied shouldn't have > any target attribute. What does this sentence mean? David