From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33011 invoked by alias); 14 Oct 2015 06:23:14 -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 32972 invoked by uid 48); 14 Oct 2015 06:23:10 -0000 From: "chrisb2244 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings Date: Wed, 14 Oct 2015 06:23: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: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chrisb2244 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 target_milestone 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: 2015-10/txt/msg01071.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67960 Bug ID: 67960 Summary: Prefixing a function with [[deprecated]] produces multiple warnings Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chrisb2244 at gmail dot com Target Milestone: --- The [[deprecated]] prefix for a function produces multiple warnings. In v5.2.0, there are 3 warnings for the code [[deprecated]] void doNothing(){} int main(){ doNothing(); } I am informed that in v4.9.2, only 2 warnings are emitted for the same code - http://stackoverflow.com/questions/33117030/when-using-deprecated-the-warning-is-given-3-times?noredirect=1#comment54048535_33117030 Replacing the body of main with auto f = doNothing; f(); reduces the output to 2 warnings in v5.2.0, and apparently 1 warning in 4.9.2 Bug 17729 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729) seems to be about a similar issue (the same issue?) but there discusses the attribute rather than a tag - I assume the tag is implemented in terms of the attribute but am unsure hence a new bug report.