From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3004 invoked by alias); 8 Jul 2014 18:11:49 -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 2898 invoked by uid 48); 8 Jul 2014 18:11:40 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61754] New: [C++1y] [[deprecated]] attribute warns annoyingly compared to __attribute__((deprecated)) Date: Tue, 08 Jul 2014 18:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: daniel.kruegler at googlemail 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-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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-07/txt/msg00498.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61754 Bug ID: 61754 Summary: [C++1y] [[deprecated]] attribute warns annoyingly compared to __attribute__((deprecated)) Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: daniel.kruegler at googlemail dot com The following code, compiled with 4.10.0 20140707 (experimental) using the compiler settings: -Wall -Wextra -std=c++1y -pedantic //----------------- struct __attribute__((deprecated)) Old1 {}; Old1 old1 __attribute__((deprecated)); struct [[deprecated]] Old2 {}; Old2 old2 [[deprecated]]; // ## int main() {} //----------------- produces a warning on the line marked with ##: "warning: 'Old2' is deprecated (declared at prog.cc:5) [-Wdeprecated-declarations] Old2 old2 [[deprecated]]; ^" Note that the corresponding example using type Old1 does not so. Is the difference in behaviour intended? I'm pretty sure that either variant is conforming, but this has the effect that it makes [[deprecated]] much less attractive in real-world code bases. Please let me know whether the difference is due to your reading of the standard, in this case I would like to submit a core language issue to make the wording clearer for such situations.