From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: Christophe Lyon <christophe.lyon.oss@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
"libstdc++" <libstdc++@gcc.gnu.org>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [committed 2/2] libstdc++: Add [[nodiscard]] to sequence containers
Date: Thu, 5 Aug 2021 15:13:57 +0300 [thread overview]
Message-ID: <CAFk2RUa6Dgor3fx2pfY5gZN52yZcnMvw-ODtxJ=q3ejPVBt9=Q@mail.gmail.com> (raw)
In-Reply-To: <CAKhMtSL8mzfM84NHJF3PU3HQBJ8BGDWuF+s-xTdfm_KSDeGwAA@mail.gmail.com>
On Thu, 5 Aug 2021 at 15:11, Christophe Lyon via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Hi Jonathan,
>
> On Wed, Aug 4, 2021 at 2:04 PM Jonathan Wakely via Gcc-patches <
> gcc-patches@gcc.gnu.org> wrote:
>
> > On 04/08/21 12:56 +0100, Jonathan Wakely wrote:
> > >... and container adaptors.
> > >
> > >This adds the [[nodiscard]] attribute to functions with no side-effects
> > >for the sequence containers and their iterators, and the debug versions
> > >of those containers, and the container adaptors,
> >
> > I don't plan to add any more [[nodiscard]] attributes for now, but
> > these two commits should demonstrate how to do it for anybody who
> > wants to contribute similar patches.
> >
> > I didn't add tests that verify we do actually warn on each of those
> > functions, because there are hundreds of them, and I know they're
> > working because I had to alter existing tests to not warn.
> >
> >
> I've noticed a regression on aarch64/arm:
> FAIL: g++.old-deja/g++.other/inline7.C -std=gnu++17 (test for excess
> errors)
> Excess errors:
> /gcc/testsuite/g++.old-deja/g++.other/inline7.C:11:11: warning: ignoring
> return value of 'std::__cxx11::list<_Tp, _Alloc>::size_type
> std::__cxx11::list<_Tp, _Alloc>::size() const [with _Tp = int*; _Alloc =
> std::allocator<int*>; std::__cxx11::list<_Tp, _Alloc>::size_type = long
> unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
>
> FAIL: g++.old-deja/g++.other/inline7.C -std=gnu++2a (test for excess
> errors)
> Excess errors:
> /gcc/testsuite/g++.old-deja/g++.other/inline7.C:11:11: warning: ignoring
> return value of 'std::__cxx11::list<_Tp, _Alloc>::size_type
> std::__cxx11::list<_Tp, _Alloc>::size() const [with _Tp = int*; _Alloc =
> std::allocator<int*>; std::__cxx11::list<_Tp, _Alloc>::size_type = long
> unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
>
> Not sure why you didn't see it?
That can easily happen when running just the library tests, rather
than all of them. :P
next prev parent reply other threads:[~2021-08-05 12:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 11:55 [committed 1/2] libstdc++: Add [[nodiscard]] to iterators and related utilities Jonathan Wakely
2021-08-04 11:56 ` [committed 2/2] libstdc++: Add [[nodiscard]] to sequence containers Jonathan Wakely
2021-08-04 12:00 ` Jonathan Wakely
2021-08-05 12:09 ` Christophe Lyon
2021-08-05 12:13 ` Ville Voutilainen [this message]
2021-08-05 14:21 ` Jonathan Wakely
2021-08-05 14:38 ` Jonathan Wakely
2021-08-05 14:19 ` [committed] libstdc++: Move attributes that follow requires-clauses [PR101782] Jonathan Wakely
2021-08-05 14:27 ` Ville Voutilainen
2021-08-05 14:40 ` Jonathan Wakely
2021-08-05 18:02 ` Jonathan Wakely
2021-08-06 13:29 ` Jonathan Wakely
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='CAFk2RUa6Dgor3fx2pfY5gZN52yZcnMvw-ODtxJ=q3ejPVBt9=Q@mail.gmail.com' \
--to=ville.voutilainen@gmail.com \
--cc=christophe.lyon.oss@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--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).