public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: nodiscard-reason-nonstring.C FAIL in C++26
@ 2023-11-07 15:50 Marek Polacek
  2023-11-07 15:54 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2023-11-07 15:50 UTC (permalink / raw)
  To: Jason Merrill, Jakub Jelinek, GCC Patches

Tested on x86_64-pc-linux-gnu, ok for trunk?

-- >8 --
Since r14-5071, we emit an extra error for this test (the first one):

nodiscard-reason-nonstring.C:5:13: error: expected string-literal before numeric constant
nodiscard-reason-nonstring.C:5:36: error: 'nodiscard' attribute argument must be a string constant

so the test needs adjusting.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Adjust dg-error.
---
 gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
index 091c3e56bd2..cbc04b406c6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
@@ -2,7 +2,7 @@
 /* { dg-do compile { target c++20 } } */
 /* { dg-options "-O" } */
 
-[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant" } */
+[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant|expected string-literal" } */
 
 void
 test (void)

base-commit: 75e5a467811da4237d5c43b455202c832f6e064e
-- 
2.41.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: nodiscard-reason-nonstring.C FAIL in C++26
  2023-11-07 15:50 [PATCH] testsuite: nodiscard-reason-nonstring.C FAIL in C++26 Marek Polacek
@ 2023-11-07 15:54 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2023-11-07 15:54 UTC (permalink / raw)
  To: Marek Polacek; +Cc: Jason Merrill, GCC Patches

On Tue, Nov 07, 2023 at 10:50:42AM -0500, Marek Polacek wrote:
> Tested on x86_64-pc-linux-gnu, ok for trunk?
> 
> -- >8 --
> Since r14-5071, we emit an extra error for this test (the first one):
> 
> nodiscard-reason-nonstring.C:5:13: error: expected string-literal before numeric constant
> nodiscard-reason-nonstring.C:5:36: error: 'nodiscard' attribute argument must be a string constant
> 
> so the test needs adjusting.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Adjust dg-error.

LGTM.

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-07 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07 15:50 [PATCH] testsuite: nodiscard-reason-nonstring.C FAIL in C++26 Marek Polacek
2023-11-07 15:54 ` 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).