public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] testsuite: Fix up pr104601.C for recent libstdc++ changes
Date: Fri, 15 Mar 2024 10:08:29 +0100	[thread overview]
Message-ID: <ZfQQDdxw8vFTwjGC@tucnak> (raw)
In-Reply-To: <20240314170050.2835263-1-jwakely@redhat.com>

Hi!

On Thu, Mar 14, 2024 at 04:58:41PM +0000, Jonathan Wakely wrote:
> Add the [[nodiscard]] attribute to several functions in <algorithm>.

r14-9478 added [[nodiscard]] to various <algorithm> APIs including find_if
the pr104601.C testcase uses.  As it is an optimization bug fix testcase,
haven't tried to adjust the testcase to use the find_if result, but instead
have added -Wno-unused-result flag to quiet the warning.

The testcase tests side-effects of the lambda used by find_if rather than
its actual result.

Tested on x86_64-linux -m32/-m64, committed to trunk as obvious.

2024-03-15  Jakub Jelinek  <jakub@redhat.com>

	* g++.dg/torture/pr104601.C: Add -Wno-unused-result to dg-options.

--- gcc/testsuite/g++.dg/torture/pr104601.C.jj	2022-05-23 21:44:48.390854093 +0200
+++ gcc/testsuite/g++.dg/torture/pr104601.C	2024-03-15 09:59:08.581824938 +0100
@@ -1,6 +1,6 @@
 // PR tree-optimization/104601
 // { dg-do run }
-// { dg-options "-std=c++17" }
+// { dg-options "-std=c++17 -Wno-unused-result" }
 
 #include <algorithm>
 #include <optional>


	Jakub


      reply	other threads:[~2024-03-15  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 16:58 [committed] libstdc++: Add nodiscard in <algorithm> Jonathan Wakely
2024-03-15  9:08 ` Jakub Jelinek [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=ZfQQDdxw8vFTwjGC@tucnak \
    --to=jakub@redhat.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).