public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: warnings about unused shared_ptr/unique_ptr comparisons
Date: Mon, 14 Jan 2019 20:41:00 -0000	[thread overview]
Message-ID: <20190114204102.GA25940@redhat.com> (raw)
In-Reply-To: <f1041ef5-86c8-3a77-7965-49cb0ed18c64@redhat.com>

On 14/01/19 16:53 +0100, Ulrich Drepper wrote:
>This is a conservative implementation of a patch to make
>shared/unique_ptrs behave more like plain old pointers.  More about this
>in bug #88738
>
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88738
>
>The summary is
>
>- using clang, which enables a warning for unused results of all
>comparison operation, found a real bug
>
>- a library implementation is limited in scope and tedious to add
>everywhere. At this stage of gcc 9 it was the only acceptable solution,
>though
>
>- longer term there should be a warning for comparison operators.
>Possibly on by default with the possibility to disable it with an
>attribute (see the discussion in the bug).
>
>
>The patch proposed here only changes the code for C++17 and up to use
>the [[nodiscard]] attribute.  For gcc 10 we can either widen this or
>implement a better way with the help of the compiler.
>
>I ran the regression test suite and didn't see any additional failures.
>
>OK?

As it only makes changes for C++17 and up, this is OK for trunk now.
Thanks.

      parent reply	other threads:[~2019-01-14 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 15:53 Ulrich Drepper
2019-01-14 16:04 ` Kyrill Tkachov
2019-01-14 20:41 ` Jonathan Wakely [this message]

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=20190114204102.GA25940@redhat.com \
    --to=jwakely@redhat.com \
    --cc=drepper@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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).