public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] testsuite: Fix up pr109524.C for -std=c++23 [PR109524]
       [not found] <20230417084143.A57C2385783F@sourceware.org>
@ 2023-04-19  8:14 ` Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-04-19  8:14 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Mon, Apr 17, 2023 at 08:41:38AM +0000, Richard Biener via Gcc-patches wrote:
> 	* g++.dg/pr109524.C: New testcase.

This testcase was reduced such that it isn't valid C++23, so with my
usual testing with GXX_TESTSUITE_STDS=98,11,14,17,20,2b it fails:
FAIL: g++.dg/pr109524.C  -std=gnu++2b (test for excess errors)
.../gcc/testsuite/g++.dg/pr109524.C: In function 'nn hh(nn)':
.../gcc/testsuite/g++.dg/pr109524.C:35:12: error: cannot bind non-const lvalue reference of type 'nn&' to an rvalue of type 'nn'
.../gcc/testsuite/g++.dg/pr109524.C:17:6: note:   initializing argument 1 of 'nn::nn(nn&)'
The following patch fixes that and I've verified it doesn't change
anything on what the test was testing, it still ICEs in r13-7198 and
passes in r13-7203, now in all language modes (except for 98 where
it is intentionally UNSUPPORTED).

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

2023-04-19  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/109524
	* g++.dg/pr109524.C (nn::nn): Change argument type from nn & to
	const nn &.

--- gcc/testsuite/g++.dg/pr109524.C.jj	2023-04-17 11:44:12.405551621 +0200
+++ gcc/testsuite/g++.dg/pr109524.C	2023-04-19 09:54:45.211210827 +0200
@@ -14,7 +14,7 @@ struct _Guard {
 };
 struct nn {
   int * _M_dataplus;
-  nn(nn &)
+  nn(const nn &)
         {
                 f();
                 _Guard   __guard;


	Jakub


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-19  8:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230417084143.A57C2385783F@sourceware.org>
2023-04-19  8:14 ` [committed] testsuite: Fix up pr109524.C for -std=c++23 [PR109524] Jakub Jelinek

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).