public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/33911] attribute deprecated vs. templates
Date: Thu, 13 Nov 2014 03:06:00 -0000	[thread overview]
Message-ID: <bug-33911-4-iqluJXa5KH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-33911-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33911

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've fixed most of the tests but I think the remaining ones reveal that the
warning is a bit too eager:

template<typename T>
struct B
{
  B(T t) { }

} __attribute__ ((__deprecated__));

template<typename T>
B<T> b(T t)
{
  return B<T>(t);
}

int main()
{
}

dep.cc:9:11: warning: ‘B’ is deprecated (declared at dep.cc:2)
[-Wdeprecated-declarations]
 B<T> b(T t)
           ^
dep.cc: In function ‘B<T> b(T)’:
dep.cc:11:16: warning: ‘B’ is deprecated (declared at dep.cc:2)
[-Wdeprecated-declarations]
   return B<T>(t);
                ^

The warning comes even when b() isn't instantiated and can't be disabled with a
#pragma.

I have no idea why this only affects 3 tests, not all the -std=gnu++11 tests,
so maybe I should just add -D_GLIBCXX_USE_DEPRECATED=0 to the dg-options for
those three tests to prevent the deprecated components being included.
>From gcc-bugs-return-466601-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Nov 13 03:55:13 2014
Return-Path: <gcc-bugs-return-466601-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18844 invoked by alias); 13 Nov 2014 03:55:12 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18814 invoked by uid 48); 13 Nov 2014 03:55:07 -0000
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63843] [5 Regression] wrong code generation at -O1 and higher
Date: Thu, 13 Nov 2014 03:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hjl.tools at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on target_milestone short_desc everconfirmed
Message-ID: <bug-63843-4-2VDr7anxxn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63843-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63843-4@http.gcc.gnu.org/bugzilla/>
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-11/txt/msg01073.txt.bz2
Content-length: 738

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc843

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-13
   Target Milestone|---                         |5.0
            Summary|wrong code generation at    |[5 Regression] wrong code
                   |-O1 and higher              |generation at -O1 and
                   |                            |higher
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It is caused by r217118.


  parent reply	other threads:[~2014-11-13  3:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-33911-4@http.gcc.gnu.org/bugzilla/>
2012-12-01 22:12 ` paolo.carlini at oracle dot com
2012-12-02  8:16 ` victor at enise dot org
2012-12-02  9:57 ` paolo.carlini at oracle dot com
2012-12-02 12:39 ` redi at gcc dot gnu.org
2013-10-01  0:06 ` eraman at google dot com
2013-10-03 17:39 ` eraman at gcc dot gnu.org
2014-11-11 14:18 ` redi at gcc dot gnu.org
2014-11-11 14:25 ` redi at gcc dot gnu.org
2014-11-11 17:52 ` jason at gcc dot gnu.org
2014-11-12 10:33 ` redi at gcc dot gnu.org
2014-11-13  3:06 ` redi at gcc dot gnu.org [this message]
2014-11-17 22:10 ` jason at gcc dot gnu.org
2022-03-02 15:51 ` ldionne.2 at gmail dot com
2007-10-26 15:08 [Bug c++/33911] New: " bkoz at gcc dot gnu dot org
2007-10-26 16:08 ` [Bug c++/33911] " pcarlini at suse dot de
2007-12-20 14:33 ` niemayer at isg dot de
2008-01-04 22:57 ` jason at redhat dot com
2008-05-02 21:41 ` jason at gcc dot gnu dot org
2008-12-28  3:25 ` pinskia at gcc dot gnu dot org
2009-11-05 23:09 ` jason at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-33911-4-iqluJXa5KH@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).